我有一个简单的Web服务,如下所示

/**
 * 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 + " !";
  }
}


是否有一种方法(使用批注或其他方式)将注释添加到Web服务或Web方法,以便当第三方调用(或检查WSDL)时,存在描述Web服务,其方法和参数的注释/文档。 ;非常类似于后来包含在Java文档中的注释。

我认为这是.NET Web服务的possible(最后评论),但是在Java Web服务中不确定。

最佳答案

您可以将<wsdl:documentation>元素添加到wsdl中:WSDL Document Structure

09-05 09:52
查看更多