Hi!
I remember when I started looking at
SOAP web services and WSDLs. At that time, I thought WSDLs were slightly frightening and difficult to grasp.
Despite the experience I have gained, I still do not sit down and write a WSDL document from scratch, so I am going to suggest a slightly more convenient approach to WSDL-first web service development. I call this method "WSDL first with Some Java in the Beginning".
- Write a Java class representing the endpoint implementation class, but that only contains empty methods, that is, methods with no code (except for perhaps returning null or zero values as the result of the methods).
This class is to be annotated with all the appropriate web service annotations.
- If any bean classes are needed to pass information to, or return information from, methods in the class in the previous step then implement these.
- Use wsgen to generate a WSDL document from the Java class in the previous step.
- Manually edit the generated WSDL document and customize it as desired.
- Use the WS-I Basic Profile tool to verify that the WSDL complies with the WS-I Basic Profile.
This tool can be downloaded freely from:
http://www.ws-i.org/deliverables/workinggroup.aspx?wg=testingtools
- Delete all the Java code written in the first two steps.
- Use wsimport to generate server side artifacts from the WSDL.
- Fill in the implementation of the different methods in the endpoint implementation class generated in the previous step.
- Use wsimport to generate client side artifacts from the WSDL.
- Implement a client using the artifacts generated in the previous step.
Best wishes!