We will use the same WSDL document that we used in our earlier example. The contract is given below:
Step: 1 Run the wsdl2java tool to generate the requires service class, JAXB input output message classes. |
wsdl2java.bat -d src -ant -impl -server rateService.wsdl |
This command will generate: |
JAXB Input and Output message classes, Service Interface, Service Implementation class, Standalone Server class and an ant build file to build the service. If you open up these files in the editor, then you see various JAXB annotations on classes and methods which are used to map a Java class to XML. It will also generate Request and Response Wrapper classes as with the JAX-WS specification. It also generate Request and Response Wrapper classes as with the JAX-WS specification |
Step: 2 Implement the Service Interface. A skeleton of the class is already generated with all the required Webservice annotations. A standalone server class is also generated to test the service. The ant file generated will have a target for running the server and the client. |
To publish the service execute the ant task InterestRateServiceServer |
Comments