Creating a Web service client for the IBM WebSphere JAX-RPC runtime environment using Ant tasks

If you have a WSDL file, you can use Ant in the Eclipse workspace to generate a Web service client with the IBM® WebSphere® JAX-RPC runtime environment.
Before creating the Web service client, you must complete the following prerequisites:
In order to create the Web service client, you must modify the Ant file and the Ant properties file.
  1. Edit the Ant file (wsgen.xml) that you imported as a prerequisite for this task. Ensure that the file refers to the client Ant properties file: the Ant file should contain the line <property file="was_jaxrpc_client.properties"/>. Save any changes that you made to the file.
  2. Edit the jax_rpc_client.properties file that you imported as a prerequisite for this task.
    1. Ensure that the ScenarioType parameter is set to client.
    2. Set the InitialSelection parameter to the location of your WSDL file.
    3. Set the ClientComponentType parameter to the type of client that you want to create. There are four types of client: Web, EJB, J2EE J2EE Application Client, and Java™ Utility. (For more information, see the related topic.)
    4. All of the other parameters are optional: delete them if they are not explicitly set. The default values for the remaining parameters will be retrieved from the settings and preferences for your dynamic project. (For more information about setting these parameters, see the related topics.)
    Save any changes that you made to the Ant properties file.
  3. Run your Ant task in one of two ways:
    • If you want to run the task in the product workspace:
      1. Right-click wsgen.xml and select Run As > Ant Build.
      2. In the dialog box, click the JRE tab and select Run in the same JRE as the workspace.
      3. Click Apply and then click Run.
    • If you want to run the task in a command line:
      1. Change the script for running your Ant task.
      2. Enter wsant in the command line.
      3. Optional: After your Web service is generated, review the wsgen.txt file for information about the task that you ran.
    After your Web service is generated, the console or command line displays a Build Successful message.

When your Web service client is generated, some files are created and placed in your project.

If your Web service client is a Web type, the WSDL file for the client is placed in the WEB-INF\wsdl folder of your project. Several deployment descriptors are placed under the WEB-INF folder of your project:
  • ibm-webservicesclient-bnd.xmi
  • ibm-webservicesclient-ext.xmi
  • webservicesclient.xml (in J2EE 1.3 only)

If your Web service client is an EJB type or a J2EE Application Client type, the created files are placed under the META-INF folder.

For more information, see the related topics:


Feedback