Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

One of the easiest ways to do this in JAVA is to use JAX-WS and Maven with plugin called jaxws-maven-plugin. The example Maven pom.xml file could look like this:

Code Block
languagehtml/xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example.integration.crm</groupId>
    <artifactId>example-client</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>Example integration project</name>
    <description>Example integration project</description>
    <scm>
        <developerConnection>scm:svn:https://svn.example.com/svn/dev/integration/example-client</developerConnection>
    </scm>
    <properties>
        <project.java.version>1.6</project.java.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>javax.xml.ws</groupId>
                <artifactId>jaxws-api</artifactId>
                <version>2.2.7</version>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>2.2.6</version>
            </dependency>
            <dependency>
                <groupId>javax.xml.soap</groupId>
                <artifactId>saaj-api</artifactId>
                <version>1.3.4</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.1.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.jws</groupId>
            <artifactId>jsr181-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml.soap</groupId>
            <artifactId>saaj-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jax-qname</artifactId>
            <version>1.1</version>
        </dependency>
    </dependencies>
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${project.java.version}</source>
                    <target>${project.java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packageName>com.example.service</packageName>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Place the WSDL document in <project_dir>/src/wsdl and run the following command to generate the class source files:

...

 

When you have successfully generated the class sources, you can start developing your service client using these classes and invoking the workflows.

...