Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache CXF: adding custom documentation in the WSDL?

I'm currently learning Apache CXF.

When CXF is generating a WSDL file from a Pojo, is there a way (a java annotation ?) to add a custom documentation to the WSDL file ? to describe a service or a parameter ?

I've already used @WebParam to set some descriptive names but I'd like to add a longer documentation. Something like...

@WebService
@Documentation("This service say hello. See http://say.hello")
public interface MyService
  {
  @WebResult(name="helloMessage")
  @Documentation("Returns the hello message")
  public String sayHello();
  }

Thanks in advance,

Pierre

like image 853
Pierre Avatar asked Jan 05 '11 09:01

Pierre


People also ask

What is CXF in WSDL?

CXF includes a Maven plugin which can generate java artifacts from WSDL. Here is a simple example: < plugin > < groupId >org.apache.cxf</ groupId > < artifactId >cxf-codegen-plugin</ artifactId >

How do I generate a class from WSDL using Apache CXF?

You will have to make sure that you create an appropriate directory structure for your project and add the earlier shown hello. wsdl file to the specified folder. The wsdl2java plugin will compile this wsdl and create Apache CXF classes in a pre-defined folder.

How does Apache CXF work?

Apache CXF™ is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI.


1 Answers

Apache CXF 2.3.0 supports this.

@WSDLDocumentation annotation to add documentation nodes to generated wsdl

like image 151
jmj Avatar answered Oct 29 '22 21:10

jmj