Generate Java Client - Axis
Run wsant.bat which invokes the wsgen.xml Ant file to generates a Java proxy from input .wsdl.
Instructions:
- Start WTP. Ensure that there is a Converter.wsdl in the WebContent\wsdl
folder as output from the previous task.
- Check the Servers view and make sure that the server is stopped. This test case will ensure that the Ant task is
able to start the server if it is not already running.
- Exit the workbench.
- Navigate to the plugins directory of the wtp installation. Change to the
org.eclipse.wst.command.env plugin and go to the
ant folder. For example: D:\wtp1110\eclipse\plugins\org.eclipse.wst.command.env_1.0.0\ant
- The following files should exist there:
- wsant.bat
- wsgen.xml
- axisservice.properties
- axisclient.properties
- Open the wsgen.xml Ant file and edit so that
property file="axisclient.properties"
.
- Save the wsgen.xml file.
- Edit the axisclient.properties file. Check that
scenarioType=client
and
InitialSelection=/testProject/WebContent/wsdl/Converter.wsdl
.
If your default server
and runtime are set in the preferences as Tomcat and Axis you can safely remove all other
properties from the file. Otherwise, set: Client.RuntimeId=org.eclipse.jst.ws.axis.creation.axisWebServiceRT
and Client.ServerId=org.eclipse.jst.server.tomcat.50
and remove the remaining properties. Defaults
will be used for unset properties.
- Save the axisclient.properties file.
- Edit the wsant.bat file. Set the local environment variables to reflect your system configuration
inluding the location of your JRE, the Eclipse startup.jar and the workspace containing the
web project and Converter.wsdl file. You may have already done this in the previous task
- Run wsant.bat
- Look at the wsgen.txt file for output. Look for a
BUILD SUCCESSFUL
message and no exceptions.
- At the command line or back in wtp navigate to the workspace to find the client ConverterProxy.java code
- Test the web service client using the Web Services Explorer.