Calling external web service from within a web service
This example shows how to wirte a web service that calls another web
service. Make sure that
"http://www.mssoapinterop.org/asmx/simple.asmx?WSDL", is up and
running before trying this sample.
Steps involved in writing this example:
- Do clientgen on the external service and put the generated
classes in to the WEB-INF/classes directory
build.xml
- Write backend java class for the web service -
HelloWorldService.java
- Write ant build file to compile and build the service.
build.xml
build-webss.xml
- compile HelloWorldService.java to output/WEB-INF/classes
- run autotype to generate the codecs for the non build in types
- run source2wsdd to generate web-services.xml deployment
file and WSL file
- put the DD file in output/WEB-INF/ directory
- run clientgen on the WSDL file 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.