get WSDL to package (Eclipse/STS)

in my job (i use opentext cws), i have case to use web service SOAP and must to use ws-import for getting java class from server.

With maven you can use 3 dependency

<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.8</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
</dependency>

add maven-failsafe-plugin

<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.6</version>
<!– Disable tests for now, until we have client jar built then we can
run as follows; To run the tests: $ mvn verfiy -DskipTests=false –>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

and add plugin ws import

<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlUrls>
<wsdlUrl>${ipaddress}/cws/services/Authentication?wsdl</wsdlUrl>
<wsdlUrl>${ipaddress}/cws/services/ContentService?wsdl</wsdlUrl>
</wsdlUrls>
<sourceDestDir>${basedir}/src/main/java/</sourceDestDir>
</configuration>
</plugin>

your class will be download to /src/main/java/

thanks//Danang

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s