Generate a Web service client from a WSDL document using the JAX-WS runtime environment

 

+

Search Tips   |   Advanced Search

 

 

Overview:

The Web Service Client wizard assists you in generating a Java bean proxy and a sample Web application.

The sample Web application demonstrates how to code a proxy file.

 

Prerequisites:

To run a simple Java Web service client outside of any J2EE container, generate the Web service client into a simple Java project. The Web service wizard cannot create a simple Java project.

The closest form is an utility project, however running a simple Java Web service client (containerless) from an utility project is not supported. You must create a simple Java project before running the Web service client wizard.

To generate a Java client proxy and a sample application from a discovered WSDL document:

  1. Switch to the Java EE perspective

    Window | Open Perspective | Java EE

  • To display the various Web service wizards.

    File | New | Other | Web Services | Web Service Client | Next

  • On the Web Services page, select the WSDL file that you will use to generate the client. You can optionally choose to do the following:

    1. Select the stages of Web service client development that you want to complete using the slider. This will set several default values on the remaining wizard panels.

      Develop Develop the WSDL definition and implementation of the Web service client. This includes such tasks as creating the modules which will contain the generated code, WSDL files, deployment descriptors, and Java files when appropriate.
      Assemble Ensure the project that will host the Web service client gets associated to an EAR when required by the target application server.
      Deploy Create the deployment code for the client.
      Install 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 Start the server once the client has been installed on it.
      Test 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 runtime is displayed. If you want to deploy your service to a different runtime click the link to specify a different runtime.

    4. Select the client project: the project selected in your workspace is displayed. To select a different project and EAR click on the project link. You can select a dynamic Web project, an EJB project, a Java project, or a Java EE application client project as the location for the client code. 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. For JAX-WS Web services, the server and client projects can share the same EAR.

    5. 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. Note that if you are routing Web service traffic through the TCP/IP monitor that you cannot test the Web service using the Universal Test Client.

  • WebSphere JAX-WS Web Service Client Configuration page:

  • Custom binding declaration page: If you selected to supply a JAX-WS or JAXB binding file on the previous page, you can browse to where they are located.

  • Proxy generation configuration page: If you selected to customize the client proxy class name, use this page to specify a proxy class name for each port.

  • Web Service Client Test page:

  • 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, the Universal test client, or the Web Services Explorer.

    Related concepts

    IBM WebSphere JAX-WS runtime environment

    Related tasks

    Creating a Web service from a Java bean using the IBM WebSphere JAX-WS runtime environment

    Creating a Java bean skeleton from a WSDL document using the WebSphere JAX-WS runtime environment

    Related Concepts

    Web services development

    Web services runtime environments

    Related Tasks

    Developing Web services

    Using the Web Services Explorer