Developing a Web Service from a WSDL Description (Top down approach)
Download Addition.wsdl
Define the following directory/file structure:
- Addition
- META-INF
- Addition.wsdl
Generate the Java files on the server side using the following command:
wsdl2java.bat -uri META-INF/Addition.wsdl -p addition -d adb -s -ss -sd -ssi
or
wsdl2java.bat -uri META-INF/Addition.wsdl -p addition -d adb -s -ss -sd -ssi .
Add service processing logic to the server implementation class (
AdditionServiceSkeleton.java):
int a = additionner0.getEntier1();
int b = additionner0.getEntier2();
calculette.AdditionnerResponse resp = new calculette.AdditionnerResponse();
resp.setResultat1(a+b);
return resp;
start an axis server with the service by running ant start.server.
Deploy the service on Axis by copying build/lib/AdditionService.aar to /repository/services directory of axis.
Write a client to query this service (by running wsdl2java.sh -uri http://localhost:8080/axis2/services/AdditionService?wsdl -d adb)
Back to top