1

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.

n002213f
  • 7,805
  • 13
  • 69
  • 105
  • possible duplicate of [Any way to generate WSDL documentation from Javadoc with JAX-WS?](http://stackoverflow.com/questions/1746199/any-way-to-generate-wsdl-documentation-from-javadoc-with-jax-ws) – Bozho Aug 11 '10 at 08:53
  • exploring http://enunciate.codehaus.org/ – n002213f Aug 12 '10 at 06:08

2 Answers2

0

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

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
0

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

Plays really well with Maven.

Community
  • 1
  • 1
n002213f
  • 7,805
  • 13
  • 69
  • 105