0

I'm using Enunciate on a multi module maven project. I use version 1.28 and I just use it for documentation purposes on SOAP Services.

This works just fine for all the Services. The targetNamespace and endpointInterface has to be declared in the @WebService annotation and everything works fine. I got my zip with wsdl/wadl/xsd/html output.

All javadoc is recognized and published through the output files.

BUT...I would not write here if there is no but...

All data model files won't! I tried the following options:

<api-import pattern="package.model.**" /> 
<modules>
    <spring-app disabled="true" />
    <docs docsDir="/docs" title="Web Service API" copyright="ME" />
    <!-- Disable all the client generation tools -->
    <basic-app disabled="true" />
    <c disabled="true" />
    <csharp disabled="true" />
    <java-client disabled="true" />
    <jaxws-client disabled="true" />
    <jaxws-ri disabled="true" />
    <jaxws-support disabled="true" />
    <jersey disabled="true" />
    <obj-c disabled="true" />
    <xml forceExampleJson="true" />
    <jaxws disabled="true" />
    <amf disabled="true" />
</modules>

module is not included in webarchive but declared as dependency:

<dependency>
   <groupId>package.model</groupId>
   <artifactId>model</artifactId>
   <version>${project.parent.version}</version>
   <scope>provided</scope>
</dependency>

The DTOs and ENUMS in the Data Model are normally provided with:

@XmlType(namespace = "https://package/DTO")

And Javadoc on class and attributes.

But I tried Javadoc on getters and setters too.

I even tried some xml annotation from the example implementation in my project:

@javax.xml.bind.annotation.XmlType(name = "socialGroup", namespace = "http://api.ifyouwannabecool.com/link")
@javax.xml.bind.annotation.XmlRootElement(name = "socialGroup", namespace = "http://api.ifyouwannabecool.com/link")

Without success. The javadoc won't be included in xsd/wsdl/html files as it does for the SOAP Services.

Do you have any idea?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

3 Answers3

0

If the classes are in a different Maven module, as you have declared in a dependency, you have to explicitly tell Enunciate to "import" them in order to get the JavaDoc included.

So let's pretend your model classes are in a package called "org.mycompany.widgets.model" and in a package called "org.mycompany.gadgets.model". Tell Enunciate to import those like this:

<enunciate ...>
  ...
  <api-import pattern="org.mycompany.gadgets.model.**"/>
  <api-import pattern="org.mycompany.widgets.model.**"/>
  ...
Ryan Heaton
  • 1,173
  • 7
  • 11
0

Please add @XmlRootElement on top of the class so that enunciate will make them appear in Data Model documentation.

Example : 

@XmlRootElement
public class Foo{
....
}
0

I think the problem is <scope>provided</scope>. If the classes aren't present in the classpath, enunciate will not be able to find them. Change it to <scope>compile</scope>, along with the @XmlRootElement annotations and it should work.