Skip to main content

Posts

Showing posts from July, 2014

Sample Web service and client creation using WSDL with Maven and JAX-WS

How to generate client via WSDL file By executing following command on linux bash command line, cloud be obtain the service port classes > wsimport -keep -verbose http://compA.com/ws/HelloService.wsdl -b binding.xml OR > wsimport -keep -verbose /home/malith/HelloService.wsdl -b binding.xml Note : The binding xml is need to avoid generating JAXB element contents ------ How to create web service By above code generation, we can obtain Interface class which contains the service bridge. We could be wright sample web service by implementing the interface by additionally adding teh @WebService annotation Create the sun-javaws.xml in WEB-INF folder to define web service mappings E.g. @WebService(name = "Hello_", targetNamespace = "http://www.examples.com/wsdl/HelloService.wsdl") public class HelloWebService implements HelloPortType {     /**      * @param firstName      * @return returns java.lang.String ...