I am new to java WS and WSDL.
I used wsdl2java to create java classes for my web service client and there was a class created with <Service Name>Service extends javax.xml.ws.Service
Please let me know what is the use of the class
I think of this as a 'locator' or 'factory' which can be used for making client-side (proxy) instances of the service. For example (where 'Example' is the Service Name):
ExampleService locator = new ExampleService();
locator.addPort( ExampleService.Example, SOAPBinding.SOAP11HTTP_BINDING
, "http://myserver:8080/myapp/services/example" );
// now get the instance
Example example = locator.getExample();
Though with CXF you can use utilities such as the JaxWsProxyFactoryBean
and ignore the <Service Name>Service
class. Eg:
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(Example.class);
factory.setAddress("http://myserver:8080/myapp/services/example");
factory.setUsername("user");
factory.setPassword("password");
Example example = (Example) factory.create();