CXF also includes a Maven plugin which can generate WSDL from Java code. Here is a simple example:
Code Block | ||||
---|---|---|---|---|
| ||||
<plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>2.0.9</version> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>2.0.9</version> </dependency> </dependencies> <executions> <execution> <id>generate-wsdl</id> <phase>process-classes</phase> <configuration> <className>org.example.MyService</className> </configuration> <goals> <goal>java2wsdl</goal> </goals> </execution> </executions> </plugin> |
Here are the options you can use:
Code Block |
---|
<configuration> <className>...</className> <classpath>...</classpath> <outputFile>...</outputFile> <serviceName>...</serviceName> <soap12>...</soap12> <targetNameSpace>...</targetNameSpace> <verbose>...</verbose> <quiet>...</quiet> </configuration> |