Generating a Java client proxy and a sample application from a WSDL document using the IBM SOAP 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 a WebSphere server, create a dynamic Web project targeted to the appropriate server as described in Creating a WebSphere 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 Project Explorer 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 panel: Select the type of proxy to be generated, and whether or not it will be tested.

  5. Client Environment Configuration page: Select the run-time environment and the server for your Web service client.

    1. Click Explore Options and select the IBM SOAP run-time environment and select the server on which you want to run your Web service client. If you want to use the Apache Axis 1.0 run-time environment or the IBM WebSphere run-time environments, refer to the appropriate task.

    2. Select the type and name of project in which you want the Web service client created.

      • If you enter the name of an existing project, the project type field must match that of the existing project. 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.

      • If you enter a name of a project that does not already exist, the wizard will create the project for you.

      • Note that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, select the WebSphere run-time environment for your client.

    3. Select an existing EAR or enter a unique name to associate the Web service client with a different EAR than the Web service EAR. Note: Selecting different EARs for the Web service and Web service client can reduce the chance of encountering run time errors, but will use more system resources.

  6. Web Service Selection panel: Enter the URI to the WSDL, WSIL, or HTML file that will be used to generate the Java bean. You can optionally generate a WSIL file from this file as well.

  7. Web Service Binding Proxy Generation panel: Select the binding and proxy options.

  8. Web Service Proxy Test panel: 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. Click Finish

Notes:

Important: It is recommended that you select the service WSDL document rather than the binding WSDL document in order to generate a client proxy that contains the complete endpoint information. The service element is the basis for the Business Service that you will publish. You cannot publish a Business Service using a WSDL document that does not have service elements. If you generate a proxy from a WSDL binding document, call the setEndPoint() method to set an endpoint URL before you call any other method in the proxy. The proxy generated from a WSDL binding document is not automatically equipped with an endpoint URL.

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.

Collected links
Tools for Web services development
Web services development

Related Tasks
Developing Web services
Publishing Web services and business entities

Related Reference
Deployment properties
Mapping properties
WSDL documents