Multiple Web Services in one war
This example shows how to pacakge multiple web services in a single
war.
Steps involved in writing this example:
- Write the complex type -
World.java
- Write backend java class for the first web service -
HelloWorldService.java
- Write backend java class for the secound web service -
HelloWorldService2.java
- Write ant build file to compile and build the service.
build.xml
build-webss.xml
- compile HelloWorldService.java and HelloWorldService2.java
to output/WEB-INF/classes
- run autotype and source2wsdd on both HelloWorldService and
HelloWorldService2 java files.
- run wsdd-merge ant task to merge both DD files in to one
web-services.xml DD file. Put this DD file in output/WEB-INF/
directory
- run clientgen on the WSDL files to generate the client jar
- jar up output directory as a war file
- compile the client side code
Main.java
- deploy the applicaiton by copying the war file into the
applications directory of the server
- Follow the instructions here
to build, run and test the service.