Reputation: 3211
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:
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
Upvotes: 1
Views: 7682
Reputation: 42020
The JSR 224 says in 3.1 section:
An SEI is a Java interface that meets all of the following criteria:
- Any of its methods MAY carry a
javax.jws.WebMethod
annotation (see 7.11.2).javax.jws.WebMethod
if used, MUST NOT have theexclude
element set totrue
.
If the implementation class include the javax.jws.WebMethod
, then you cant put @WebMethod(exclude=true)
and that in not possible, according to specification.
Depends of custom version of Eclipse, shows a warning for this. e.g. Rational Application Developer for Websphere shows:
JSR-181, 3.1: WebMethod cannot be used with the endpointInterface
property of WebService
Upvotes: 1
Reputation: 1170
While programming/building a project (with some advanced IDE) normally you should be able to find it between auto-generated stuff - the IDE should generate it. Just check carefully.
Upvotes: 0