You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

UNDER CONSTRUCTION

This document only addresses how to configure pom.xml for generating java code based on a published web service wsdl during maven build. This is not a tutorial on how to use Maven.

PREREQUISITES

Before you begin, you must have the following:

${renderedContent}

1. The pom.xml configuration

To generate java code using the moiraws web service WSDL, use the Maven maven-antrun-plugin and place following xml statements within the <plugins> element of the Maven project's pom.xml:

    <properties>
        <service.wsdl>https://ws-dev.mit.edu/moiraws/services/moira?wsdl</service.wsdl>
        <server.truststore>${env.JAVA_KEYSTORE_PATH}/myServerTrustStore.jks</server.truststore>
        <server.truststore.password>truststorePassword</server.truststore.password>
        <server.truststore.type>jks</server.truststore.type>
        <client.keystore>${env.JAVA_KEYSTORE_PATH}/myApplicationCertificateKeystore.jks</client.keystore>
        <client.keystore.password>keystorePassword</client.keystore.password>
        <client.keystore.type>jks</client.keystore.type>
    </properties>
       .
       .
       .
    <build>
       .
       .
       .
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-antrun-plugin</artifactId>
               <executions>
                   <execution>
                       <id>generate java code for moira wsdl</id>
                       <phase>generate-sources</phase>
                       <configuration>
                           <tasks>
                               <property name="compile_classpath" refid="maven.compile.classpath" />
                               <echo message="service.wsdl ${service.wsdl}" />
                               <echo message="compile classpath: ${compile_classpath}" />
                               <java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" classpathref="maven.compile.classpath" dir="src/main/java">
                                    <sysproperty key="javax.net.ssl.keyStore" value="${client.keystore}" />
                                    <sysproperty key="javax.net.ssl.keyStorePassword" value="${client.keystore.password}" />
                                    <sysproperty key="javax.net.ssl.keyStoreType" value="${client.keystore.type}" />
                                    <sysproperty key="javax.net.ssl.trustStore" value="${server.truststore}" />
                                    <sysproperty key="javax.net.ssl.trustStorePassword" value="${server.truststore.password}" />
                                    <sysproperty key="javax.net.ssl.trustStoreType" value="${server.truststore.type}" />
                                    <arg value="-v" />
                                    <arg value="-o${basedir}/src/main/java" />
                                    <arg value="${service.wsdl}" />
                               </java>
                           </tasks>
                       </configuration>
                       <goals>
                           <goal>run</goal>
                       </goals>
                   </execution>
               <executions>
           </plugin>
       </plugins>
       .
       .
       .
    <build>
        

In the above:

${renderedContent}

to:
${renderedContent}

Note: with the above plug-in configuration, maven will generate java code during generate-source phase.

The following are the web service wsdl's that are currently available from DSPS:

DSPS Staging Servers:

${renderedContent}

DSPS Production servers:

${renderedContent}
  • No labels