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 creating a Web service, you must complete the following prerequisites:
To create the Web service, modify the Ant file and the Ant properties file of the service. The name of the Ant file is wsgen.xml. The name of the Ant properties file depends on the type of Web service that you want to create:
  1. Edit the Ant file that you imported as a prerequisite for this task. Ensure that it indicates the Ant properties file: the Ant file should contain the line <property file="myPropertiesFile.properties"/>, where myPropertiesFile is one of the names shown in Table 2. Save any changes that you made to the Ant file.
  2. 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 or Java bean.
    3. 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 Web 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 is generated, the WSDL file for the service is created and placed in the WEB-INF\wsdl folder of your dynamic 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 dynamic Web project, depending on the type of Web service that you created.

For more information, see the related topics:


Feedback