Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated of cxf version from 2.0 to 2.0.2-incubator and set incubator plugin repository

...

Code Block
xml
xml
<dependencies>
	<dependency>
		<groupId>org.apache.cxf</groupId>
		<artifactId>cxf-rt-frontend-jaxws</artifactId>
		<version>2.0.2-incubator</version>
	</dependency>
	<dependency>
		<groupId>org.apache.cxf</groupId>
		<artifactId>cxf-rt-transports-http</artifactId>
		<version>2.0.2-incubator</version>
	</dependency>
        <!-- Jetty is needed if you're are not using the CXFServlet -->
	<dependency>
		<groupId>org.apache.cxf</groupId>
		<artifactId>cxf-rt-transports-http-jetty</artifactId>
		<version>2.0.2-incubator</version>
	</dependency>
</dependencies>

...

Code Block
xml
xml
<repositories>
	<repository>
		<id>apache-snapshots</id>
		<name>Apache SNAPSHOT Repository</name>
		<url>http://people.apache.org/repo/m2-snapshot-repository/</url>
		<snapshots>
			<enabled>true</enabled>
		</snapshots>
	</repository>
	<repository>
		<id>apache-incubating</id>
		<name>Apache Incubating Repository</name>
		<url>http://people.apache.org/repo/m2-incubating-repository/</url>
	</repository>
        <!-- for jaxb-impl -->
        <repository>
            <id>java.net</id>
            <url>http://download.java.net/maven/1/</url>
            <layout>legacy</layout>
        </repository> 
</repositories>

<pluginRepositories>
	<pluginRepository>
		<id>apache-plugin-snapshots</id>
		<name>Apache Maven Plugin Snapshots</name>
		<url>http://people.apache.org/repo/m2-snapshot-repository</url>
		<releases>
			<enabled>false</enabled>
		</releases>
		<snapshots>
			<enabled>true</enabled>
		</snapshots>
	</pluginRepository>
        <pluginRepository>
               <id>apache-plugin-incubating</id>
               <name>Apache Plugin Incubating Repository</name>
               <url>http://people.apache.org/repo/m2-incubating-repository/</url>
      	</pluginRepository>
</pluginRepositories>

...

Code Block
xml
xml
<plugin>
	<groupId>org.apache.cxf</groupId>
	<artifactId>cxf-codegen-plugin</artifactId>
	<version>2.0.2-incubator</version>
	<executions>
		<execution>
			<id>generate-sources</id>
			<phase>generate-sources</phase>
			<configuration>
				<sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
				<wsdlOptions>
					<wsdlOption>
						<wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
					</wsdlOption>
				</wsdlOptions>
			</configuration>
			<goals>
				<goal>wsdl2java</goal>
			</goals>
		</execution>
	</executions>
</plugin>

...

Code Block
xml
xml
<configuration>
  <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
  <wsdlOptions>
    <wsdlOption>
      <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
      <extraargs>
        <extraarg>-b</extraarg>
        <extraarg>${basedir}/src/main/resources/wsdl/async_binding.xml</extraarg>                              
      </extraargs>
    </wsdlOption>
  </wsdlOptions>
</configuration>

...

Code Block
xml
xml
<configuration>
  <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
  <wsdlOptions>
    <wsdlOption>
      <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
      <extraargs>
        <extraarg>-sn</extraarg>
        <extraarg>MyWSDLService</extraarg>                                                                 
      </extraargs>
    </wsdlOption>
  </wsdlOptions>
</configuration>

...

Code Block
xml
xml
<plugin>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-codegen-plugin</artifactId>
  <version>2.0<0.2-incubator</version>
  <dependencies>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxws</artifactId>
      <version>2.0<0.2-incubator</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>

...

This plugin will be ready in 2.1 realse release .Now You can use 2.1-incubator-SNAPSHOT version of this plugin.
This plugin can generate WSDL, server side code used to start web service and client side code from
a java class.
Here is a simple example:

...

The outputFile value by default will be:

Code Block

{project.build.directory}/generated/wsdl/{className}.wsdl

Refer to this link http://cwiki.apache.org/CXF20DOC/java-to-ws.htmlImage Removed for other options detailed usage.