开发者

Documenting EJB3 Web Services

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜