I have been doing some reading up on web services programming with Java, Eclipse, etc. and I found one particular example where the person created the web service and client by doing the following:
- define the web service java class (interface + impl)
- deploy the web service using Endpoint.publish
- grab the wsdl from the url of the web service (eg, localhost://greeting?wsdl)
- use wsimport to generate stubs
- create a client class using generated stubs
Is there another way to generate the wsdl without having to publish the web service and download it? Perhaps a maven plugin to auto-generate wsdl and client stubs?
Update: Rather than creating a new question I am just going to piggyback on this one.
I have created my web service by defining an interface:
@WebService
public interface HelloWorldWs {
@WebMethod
public String sayHello(String name);
}
and an impl class:
@WebService(endpointInterface = "com.me.helloworldws.HelloWorldWs")
public class HelloWorldWsImpl implements HelloWorldWs {
@Override
@WebMethod
public String sayHello(String name) {
return "Hello World Ws, " + name;
}
}
When I run wsgen I get the following error:
The @javax.jws.WebMethod annotation cannot be used in with @javax.jws.WebService.endpointInterface element.
Eclipse seems to be okay with it.
Any idea why?
Note, I originally did not have the annotation but when I tried to call my webservice I got the following error:
com.me.helloworldws.HelloWorldWsImpl is not an interface
where the person created the web .. bla bla. Can you send me link of that example, it would be very helpful for me to understand the Web Services - 09Q71AO534