Creating a Java web service for the IBM WebSphere JAX-WS runtime environment using Ant tasks

You can use an Ant task instead of the web services wizards to generate a Java™ web service for the IBM® WebSphere® JAX-WS runtime environment. Ant tasks support both bottom-up and top-down web services development.

Before you begin

Before you create 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. The name of the Ant properties file depends on the type of web service that you want to create:
  • If you want to create a bottom-up service, the name of the Ant properties file is was_jaxws_bujava.properties.
  • If you want to create a top-down service, the name of the Ant properties file is was_jaxws_tdjava.properties.
  • If you want to create a client, the name of the Ant properties file is was_jaxws_client.properties.

Procedure

Run your Ant task:
  • If you want to run the task in the product workspace:
    1. Right-click the imported web services generation XML 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.
After your web service is generated, the console or command line displays a Build Successful message.

Results

When your web service is generated, the following files are created depending on the options you selected and the type of web service generated:
  • Top-down: The Service Endpoint Interface (SEI). The SEI is the annotated Java representation of the WSDL file for the web service. This interface is used for implementing JavaBeans endpoints or creating dynamic proxy client instances. Data types references in the SEI.
  • Bottom-up: The delegate class. This class is a wrapper that contains all the methods from the bean and the JAX-WS annotation the runtime environment recognizes as a web service. If you already have a bean with the @javax.jws.WebService annotation before you run the Ant task, this bean is used as-is and new annotations are not added.
  • Request/Response/Exception wrapper classes.
Tip: The wsant.bat file is installed in the product's bin directory. On some systems, this directory might be read-only. In these cases, the Ant task cannot create the output and the web service creation fails. There are two ways to correct this problem:
  • Set your PATH to point to the bin folder, change to a directory where you have write permission, and run the script from there.
  • Copy the wsant.bat file to a writeable directory.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tantjavajaxws.html