Creating a Java web service for IBM WebSphere JAX-RPC runtime environments using Ant tasks

You can use Ant in your Eclipse workspace to generate a Java™ web service for the IBM® WebSphere® JAX-RPC runtime environment. Ant tasks support both bottom-up and top-down web services development.

Before you begin

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

About this task

To create the web service, modify the Ant properties file of the service and run the web services generation file. The name of the Ant properties file and generation file depends on the type of Web service that you want to create:
Scenario of Web Service web service Generation File Properties File
Bottom-up Java was_jaxrpc_bujava.xml was_jaxrpc_bujava.properties
Top-down Java was_jaxrpc_tdjava.xml was_jaxrpc_tdjava.properties

Procedure

  1. Edit the Ant properties file that you imported as a prerequisite for this task:
    1. Ensure that the ScenarioType parameter is set to service.
    2. Set the InitialSelection parameter to the location of your WSDL file, Java bean, or enterprise bean.
    3. All of the other parameters are optional. The default values for the remaining parameters will be retrieved from the settings and preferences for your web project. (For more information about setting these parameters, see the related topics.)
    Save any changes that you made to the Ant properties file.
  2. 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 is generated, the WSDL file for the service is created and placed in the WEB-INF\wsdl folder of your web project. Several deployment descriptors are placed under the WEB-INF folder:
  • webservices.xml
  • ibm-webservices-bnd.xmi
  • ibm-webservices-ext.xmi
In addition, other deployment descriptors and Java files may be created and placed in your web project, depending on the type of web service that you created.

For more information, see the related topics:


Feedback