java2ws — generates a WSDL document from Java code
<plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-java2ws-plugin</artifactId> <version>version
</version> <executions> <execution> <id>process-classes</id> <phase>process-classes</phase> <configuration> <className>className
</className><option>...</option>
... </configuration> <goals> <goal>java2ws</goal> </goals> </execution> </executions> </plugin>
The java2ws task takes a service endpoint implementation (SEI) and generates the support files used to implement a Web service. It can generate the following:
a WSDL document
the server code needed to deploy the service as a POJO
client code for accessing the service
wrapper and fault beans
The plug-in requires that the className
configuration element is present. The element's value is the
fully qualified name of the SEI to be processed.
The configuration element's listed in the following table can be used to fine tune the WSDL generation.
Element | Description |
---|---|
frontend | Specifies front end to use for processing the SEI and generating the support classes.
jaxws is the default. simple is also supported. |
databinding | Specifies the data binding used for processing the SEI and generating the support classes. The default when using the
JAX-WS front end is jaxb . The default when using the simple frontend is aegis . |
genWsdl | Instructs the tool to generate a WSDL document when set to true . |
genWrapperbean | Instructs the tool to generate the wrapper bean and the fault beans when set to true . |
genClient | Instructs the tool to generate client code when set to true . |
genServer | Instructs the tool to generate server code when set to true . |
outputFile | Specifies the name of the generated WSDL file. |
classpath | Specifies the classpath searched when processing the SEI. |
soap12 | Specifies that the generated WSDL document is to include a SOAP 1.2 binding when set to true . |
targetNamespace | Specifies the target namespace to use in the generated WSDL file. |