ServicesTabWebServicesNodeFuncSpec

Web Services Node in the Services Tab

Modification History:

  • Feb 2, 2007 - Winston Prakash


Note: This is just sample or a starter document to start the discussion based on Services Tab Architecture. Does not correctly reflect the implementation details. Need to be re-written by the Service Type implementor. - Winston


Contents


Introduction

The Web Services Node in the Services Tab provides functionality for the user to add, remove and modify Web Services references. When the WebService is added, a proxy client jar corresponding to the web services will be created and stored locally in the userdir along with other metadata that would explain about the WebService and it methods. The web services added can be later consumed by any application created by the user with simple gestures like drag and drop the WebService Node or one of its methods on to some of the project files being edited (ex. VWP designer or a JSP page). When a Web Service is added to Services Tab, the scope of the Web Service will be at the user level. This implies that each time a user starts Netbeans, the Web Services they've added will be displayed in the Services Tab.

Adding the WebServices

In order to add the Web Service, in the Services Tab, user selects the context menu on the Web Services root node and then selects the Add Web Service menu item as shown in the following figure. Also before adding a Web Services, the user should also get a menu item to create a new Node group (see picture below)

Image:webservice_addmenu_ServicesTabWebServicesNodeFuncSpec.png

For adding the Web Service user need to provide a valid WSDL file via the pop up dialog as

  • A URL
  • Local File or
  • A Netbeans project that contains a Web Service.

Additional functionality we should provide in the dialog is an option to view the Web Service Information area (using a check box). Once the option is selected, the dialog should display the information about the Service (as shown in figure below) and its methods, so that user would get a chance to determine if they have picked up the correct Web Service.

Another useful option may be to provide an option to check for Checking WS-I Basic Profile 1.0 Compliance. If the user selects the checkbox labeled, Check WS-I Basic Profile 1.0 compliance, the WSDL parsing functionality should report warnings if the WSDL doesn't conform to the WS-I Basic Profile.

Image:new_add_ws_ServicesTabWebServicesNodeFuncSpec.png

Deleting the Web Service

Deleting the Web Service is using the context menu item delete in the Web Service Node. Deleting the Web Service should remove the node from the Root Node as well remove the corresponding meta data from the userdir. A confirmation dialog should be supplied to prevent accidental deletion.

Updating the Web Service

Similar to deleting the web service, updating the web service is also though a context menu item update.

  • If Web Service proxy us created from an URL , then fetch the new WSDL from the URL
  • For a Local file WSDL, po up a dialog to get a location for new WSDL
  • If the proxy client was created from a project, try to load the project again?

Once the updated WSDL is obtained, remove the old proxy client jar and replace it with the new proxy client jar. Also the corresponding metadata should be updated and the UI should reflect the changes in Web Service.

Exploring the Web Service

From the Web Services root node user explores each Web Service, by selecting it in the node. User further explores the Methods of the Web Service by expanding the node. Also user gets the option to view the corresponding WSDL, by right clicking on the Web Service node and select the context menu item View WSDL

Image:Ws_explore_ServicesTabWebServicesNodeFuncSpec.jpg

When the Web Service node is selected, the property sheet may display the following properties (see figure below)

  • Web Service Name
  • Web Service Port
  • Web Service URL
  • WSDL location

Image:Ws_properties_ServicesTabWebServicesNodeFuncSpec.jpg

When the Web Service method node is selected the properties displayed may be (see figure below)

  • Method Name
  • Method Signature
  • Return type
  • List of Parameters and their type

Image:Ws_method_properties_ServicesTabWebServicesNodeFuncSpec.jpg

Testing the Web Service Method

There should be a menu option labeled, Test Method in the context menu of each method allowing the user to bring up the test dialog. The user will have an option to provide value for each of the parameters in the method, including complex reference type. The complex parameters will be shown as a tree with corresponding place for input. When the user presses the Submit} button, the results of the method call will be shown in the {{Method Test Results area of dialog shown in figure below

Image:Ws_test_dialog_ServicesTabWebServicesNodeFuncSpec.jpg

Storing the Web Service Metadata

When the Web Service is added, information about the Service will be stored as Meta Data in the userdir as follows

<userdir>/
      WebServices/
          GoogleSearch/
             GoogleSearch.xml
             GoogleSearch.wsdl
             GoogleSearch.jar
             GoogleSearch_dt.jar

In the example above GoogleSearch.xml contains the description about the Web Service. The GoogleSearch.jar is the proxy client created when Web Service was added. GoogleSearch_dt.jar contains the design time information specific to Visual Web Pack (See Web Service Node contracts for details on how the consumer specific meta data gets added)

Metadata Descriptor

The Metadata descriptor (in above example GoogleSearch.xml) contains the information about the Web Service

Ex.

<?xml version="1.0" encoding="UTF-8"?>
<ServiceType name="WebService">
   <WebService name="GoogleSearch" displayName="GoogleSearch">
      <Jar name="GoogleSearch.jar">
      <DesignTimeJar name="GoogleSearch_dt.jar"/>
      <Port name="GoogleSearchPort>
         <Method name="search">
            <Parameter type="">
            <ReturnType type="">
      </port>
   </WebService>
</ServiceType>

Adding Web Services Root Node to Services Tab

The Web Services Root Node is added to the Services Tab, via the contract published by Services Tab. So the root node should be added via the layer file as

<folder name="UI">
   <folder name="ServicesTab">
          <file name="org-netbeans-modules-websvc-nodes-WebServicesRootNode.instance" />
   </folder>
</folder>
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo