views:

63

answers:

2

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 later included in java docs.

I think this is possible (last comment) for .NET web service, but not sure in Java web services.

A: 

You can add <wsdl:documentation> elements to the wsdl: WSDL Document Structure

Andreas_D
A: 

Given the lack of standard way of generating the doc, we went the enunciate way.

Plays really well with Maven.

n002213f