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-WS
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
- Edit the wsgen.xml Ant file 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_jaxws_client.properties"/>. Save any changes that you made to the file.
- Run your Ant task in one of two
ways:
- If you want to run the task in the product workspace:
- Right-click the imported web services generation XML file and
select .
- In the dialog box, click the JRE tab and
select Run in the same JRE as the workspace.
- Click Apply and then click Run.
- If you want to run the task in a command line:
- Close your workspace before running the tasks.
- 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_jaxws_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, the following
files will be created depending on the options you have selected:
- Web service client class and proxy bean.
- Request/Response/Exception wrapper classes.
Tip: The
wsant.bat file
is installed in the product's bin directory. On some systems,
this directory may be read-only. In these cases, the ant task will
not be able to create the output and the web service creation will
fail. There are two ways to correct this:
- Set your PATH to point to the bin folder, and then change to a
directory where you have write permission and run the script from
there.
- Copy the wsant.bat file to a writeable directory.