I have a simple web service as below
/**
* Test web service
*/
@Stateless
@WebService
public class HelloWorldWebService {
/**
* Greets the user by appending 'Hello' before the name
*/
@WebMethod
public String doWork(String name){
return "Hello " + name + " !";
}
}
Is there a way (using annotations or otherwise) of adding comments to the Web Service or Web Method so that when a third party calls it (or inspects the WSDL), there are comments/documentation that describes the web service, its methods and parameters; much like comments that are 开发者_StackOverflow中文版later included in java docs.
I think this is possible (last comment) for .NET web service, but not sure in Java web services.
You can add <wsdl:documentation>
elements to the wsdl: WSDL Document Structure
Given the lack of standard way of generating the doc, we went the enunciate way.
Plays really well with Maven.
精彩评论