Create a DADX Web service

Once you have created a DADX group and a DADX file, use the Web services wizard to create and deploy a Web service. Once the Web service is created and deployed, the wizard assists you in generating a client proxy or sample application to test the new Web service. When testing is complete, you can optionally publish your Web service to a UDDI business registry.
Prerequisites:
To create the Web service:
  1. Select your DADX file.
  2. Click File > New > Other. Select Web Services in order to display the various Web service wizards. Select the Web Service wizard. Click Next.
  3. On the Web Service page select Bottom up DADX Web service from the Web service type drop down list. You can optionally choose to do the following:
    1. Select the stages of Web services development that you want to complete using the slider:
      • Develop: this will develop the WSDL definition and implementation of the Web service. This includes such tasks as creating the modules which will contain the generated code, WSDL files, deployment descriptors, and Java™ files when appropriate.
      • Assemble: this ensures the project that will host the Web service or client gets associated to an EAR when required by the target application server.
      • Deploy: this will create the deployment code for the service.
      • Install: this will install and configure the Web module and EARs on the target server. If any changes to the endpoints of the WSDL file are required they will be made in this stage.
      • Start: this will start the server once the service has been installed on it.
      • Test: this will provide various options for testing the service, such as using the Web Service Explorer or sample JSPs.
    2. Select your server: the default server is displayed. If you want to deploy your service to a different server click the link to specify a different server.
    3. Select your runtime: the default DADX runtime is displayed. If you want to deploy your service to a different DADX runtime click the link to specify a different runtime. In version 8.2 of WORF, the DADX tools supports only the Apache Axis 1.1 runtime. In version v9.1 of WORF, the Apache Axis 1.1 and IBM WebSphere JAX-RPC runtimes are supported.
    4. Select the service project: the project selected in your workspace is displayed. To select a different project and EAR click on the project link. Ensure that the project selected as the Client Web Project is different from the Service Web Project, or the service will be overwritten by the client's generated artifacts.
    5. If you want to create a client, select the type of proxy to be generated and repeat the above steps for the client.
    6. Publish the Web service: this will launch the Web Services Explorer to publish your Web service to a UDDI registry.
    7. Monitor the Web service: this will send the Web service traffic through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated by the Web service and to test this traffic for WS-I compliance. Alternately you can manually set up a TCP/IP monitor as described in Using the TCP/IP Monitor to test Web services
  4. On the Web Services DADX Group Properties page enter the information for your DADX group. This information should be dynamically pulled in from the DADX group configuration you performed in: Create a DADX group configuration, however you can overwrite or modify that information on this panel.
  5. Start Server page: if your server has not already been started you need to start it before going any further.
  6. Web Service Binding Proxy Generation page: if you have selected to generate a proxy, select the binding and proxy options.
  7. Web Service Client Test page: Use this page to select the following options:
    • Select your test facility. You can test the generated proxy in the Universal Test Client or the Web Service Explorer, or you can generate a sample Web service JSP.
    • If you selected to test the proxy through a JSP, you can select the folder where the JSP will be located, and you can select the methods that will be included in the JSP.
    • Select Run test on server to start the server for you automatically.
  8. Web Service Publication page: Select whether or not you want to publish this Web service to a UDDI registry. Click Finish.
  9. After the Web service has been created, the following may occur depending on the options you selected:
    • If you have selected to test the generated proxy using Web service JSPs, the proxy is launched in a Web browser at the following URL: http://localhost: port/WebProjectClient/sampleBeanName/ WebService/TestClient.jsp You can use this sample application to test the Web service by selecting a method, entering a value for the method, and clicking Invoke. The result of the method will display in the results pane.
    • If you have selected to test the generated proxy using the Universal Test Client, it will be launched in a browser window at the following URL: http://localhost:9080/UTC/preload?object=proxy.soap. ProxyNameProxy In the Reference pane, under Object References, expand the proxy to display the methods of the Web service. Click the method you want to test, enter a value in the Parameters pane, and click Invoke. The result will be generated below.
    • If you have selected to test the Web service using the Web Services Explorer, the Explorer will open. Select the operation you want to test, enter the required information, and click Go. The result will display in the Status pane.
    • If you have selected to publish the Web service, the Web Services Explorer is launched displaying the page required to publish your Web service to the IBM® UDDI Test Registry. Follow the instructions in Publishing the Web service to complete this task.
In creating the Web service, the following files and folders may be created, copied, or moved depending on the options you selected:
  • The plugins/com.ibm.etools.webservice.dadxtools_7.0.0/worfRuntime/worf_v82/runtime/worf/* and plugins/com.ibm.etools.webservice.dadxtools_7.0.0/worfRuntime/worf_v91/runtime/worf/* files are copied to the Web_Project/WebContent/worf directory, according to the version of WORF the project is set to.
  • A lib directory is created under the Web_Project/WebContent/WEB-INF directory. The appropriate version worf.jar and worf-servlets.jar files are copied to this directory. For Apache Axis, the required jar files are copied to this directory as well.
  • The .jsp, .html, and .gif files for the test page are created in the Web_Project/WebContent/worf directory.
  • In the Web_Project/WebContent/WEB-INF directory the web.xml file is updated with the servlet definitions for the DADX Web application. Note that two additional servlets have already been defined when a group is added to the Web project, one for the LIST function and one for the inspection.wsil listing function, at the Web Application's root context level.
  • If Apache Axis runtime environment is used, a server-config.wsdd file is created in the Web_Project/WebContent/WEB-INF directory.
  • If the IBM WebSphere runtime environment is used, the following files are created or updated:
    • webservices.xml
    • group___dadx.dadx.wsdl
    • group___dadx.dadx.xml
    • ___filename.xsd
  • In the Web_Project/WebContent directory, a WSDL file for the DADX file dadx.wsdl is created in the wsdl directory.
  • The db2WebRowSet.xsd file is also created in the Web_Project/WebContent directory.
Note that while some file names are in the same location, they are different for each version of the DADX Web Service Provider. You must not manually copy these files from or to other locations. Also, the generated files are copied from the published area to the workspace. If the files are generated from operations outside of the Web Service Wizard, for example from a browser, they will not be copied to your workspace and will be lost if another DADX Web service is created subsequently.
For more information on DB2 XML Extender and the DADX specification, refer to www.ibm.com/software/data/db2/extenders/xmlext/library.html

If you are running DADX on a remote server, you must manually copy worf.jar from the plugins/com.ibm.etools.webservice.dadxtools/worfRuntim/version/runtime folder to somewhere on your remote machine. You must then update the classpath of the remote server to reference this worf.jar file.

Important:


Feedback