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 you begin

Before creating the web service client, you must complete the following prerequisites:

About this task

In order to create the web service client, you must modify the Ant file and the Ant properties file.

Procedure

  1. Edit the Ant file (was_jaxrpc_client.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. 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 the Web service generation file 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. Close your workspace before running the tasks.
      2. Enter the following in the command line:
        • Windows: wsant.bat workspace_path wsgen_path
        • Linux: wsant.sh workspace_path wsgen_path
        where workspace_path is the fully-qualified path to your workspace, and wsgen_path is the fully qualified path to the location where your web services generation file was imported. For example your command might look like:
        wsant.bat D:\RationalAppDeveloper\workspace1 D:\RationalAppDeveloper\workspace1\TestProj\wsgenTemplates\was_jaxrpc_tdjava.xml
    After your web service is generated, the console or command line displays a Build Successful message.

Results

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 Java EE Application Client type, the created files are placed under the META-INF folder.

For more information, see the related topics:


Feedback