Bottom up Java Web Service - Axis
Run wsant.bat which invokes the wsgen.xml Ant file and generates a Java web service
bottom up from input Java source.
Instructions:
- Start WTP.
- Create a dynamic web project called buProject with an Apache Tomcat target server.
File > New > Web > Dynamic Web Project.
- Import wtp.Converter to the src folder of buProject.
Converter.zip
- Check the Servers view and make sure that the server is started.
- Exit the workbench.
- Navigate to the plugins directory of your 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 and edit the wsgen.xml Ant script so that
property file="axisservice.properties"
- Save the wsgen.xml file.
- Edit the axisservice.properties file. Check that
scenarioType=service
and InitialSelection=/buProject/src/wtp/Converter.java
. 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: Service.RuntimeId=org.eclipse.jst.ws.axis.creation.axisWebServiceRT
and Service.ServerId=org.eclipse.jst.server.tomcat.50
and remove the remaining properties. Defaults
will be used for unset properties.
- Save the axisservice.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.java file.
- 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 check the contents of the Java source folder
and the WebContent\wsdl folder in the buProject. Check to see that Converter.wsdl was
created.
Also verify that the deployment descriptors were generated in the WEB-INF\ConverterService\WTP folder:
- deploy.wsdd
- deploy.wsdd.bak
- undeploy.wsdd
- Test the web service using the Web Services Explorer.