Generating a Java client proxy and a sample application from a WSDL document using the Axis run-time environment

The Web Service Client wizard assists you in generating a Java™ bean proxy and a sample application. The sample Web application demonstrates how to code a proxy file.

Prerequisites:

  1. If you are using the Apache Jakarta Tomcat servlet container as your server, you must install it, configure an instance of it, and create a Web project targeted to it as described in Creating an Apache Tomcat server and Web project
  2. Discover and import a WSDL document into the Web project. You can only use a WSDL file that contains a service element.
To generate a Java client proxy and a sample application from a discovered WSDL document:
  1. Switch to the J2EE perspective (Window > Open Perspective > J2EE).
  2. In the Navigator view, select the Web project in which you want to generate a sample application.
  3. Click File > New > Other. Select Web Services in order to display the various Web service wizards. Select the Web Service Client wizard. Click Next.
  4. Web Services page:
    1. Enter the URI to the WSDL, WSIL, or HTML file that will be used to generate the client.
    2. Select the type of proxy to be generated
    3. Select the stages of Web services development that you want to complete using the slider:
      • Develop: this will create the client code
      • Assemble:
      • Deploy: this will create the deployment code for the client
      • Install: this will install the client on the chosen server
      • Start: this will start the server once the client has been installed on it
      • Test: this will provide various options for testing the client
    4. Select your server: the default server is displayed. If you want to deploy your client to a different server click the link to specify a different server.
    5. Select your runtime: the default runtime is displayed. If you want to deploy your client to a different runtime click the link to specify a different runtime.
    6. Select the client project: the project containing 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.
    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
  5. Web Service Proxy page: This panel shows the options for the proxy. It lists the folder where the proxy will be generated, and you can optionally create custom mappings between namespaces and packages.
  6. Web Service Namespace to Package Mappings page: if you selected Define custom mapping for namespace to package on the previous page, you can enter your custom mapping pairs on this page by clicking Add.
  7. Web Service Client Test page: This page displays if you selected to test your client. Select the test facility that you will use to test the proxy, and the methods that you want included in the proxy. Note that the Universal Test Client (UTC) is only compatible with Web service clients deployed on WebSphere® servers.
  8. Click Finish. If you have selected to test the proxy, the test client will open in a browser window.

The generated Java bean proxy provides a remote procedure call interface to the Web service. The sample Web application demonstrates how to code the proxy file.

Once you have generated your Java client proxy, you may test the methods of the Web service through the proxy using Web Services sample JSPs or the Universal test client.

For more information on creating a Web project, refer to the Web application development documentation.