Top down Java Web Service - Axis
Run wsgen.xml as an Ant build file inside the Eclipse workbench to
generate a Java web service top down from an input WSDL file.
Instructions:
- Start WTP.
- Create a dynamic web project called testProject with an Apache Tomcat target server.
File > New > Web > Dynamic Web Project .
- Import the AreaService.wsdl
file into the WebContent folder of the testProject.
- Go to the AntTest folder created in Test 1.
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=/testProject/WebContent/AreaService.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: 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.
- Right click on the wsgen.xml file and select Run As > Ant Build...
- In the Ant dialog click on the JRE tab and choose the radio button Run in the same
JRE as the workspace. Click Apply and then Run.
- Watch the console for output. Look for a BUILD SUCCESSFUL message with no exceptions.
- Check to see that AreaServiceSOAP.wsdl was created in the project's WebContent\wsdl folder
as well as the Java code in the src folder for the testProject web project in the org.tempuri.AreaService package -
- AreaService_PortType.java
- AreaService_Service.java
- AreaService_ServiceLocator.java
- AreaServiceSOAPImpl.java
- AreaServiceSOAPSkeleton.java
- AreaServiceSOAPStub.java
- Dimensions.java
Also verify that the deployment descriptors were generated in the WebContent\WEB-INF\org\tempuri\AreaService folder:
- undeploy.wsdd
- deploy.wsdd