Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

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

Panel

Before you begin, you must have the following:

indent
1
1
* an application certificate Java keystore.
If you do not have an application certificate Java keystore, click {color:blue}[here | https://wikis.mit.edu/confluence/display/WSWG/How+to+create+a+Application+Certificate+Java+keystore]{color} for instructions on how to create an application certificate Java keystore.\\
\\
* a trusted server Java keystore.
If you do not have a Trusted Server Java keystore, click {color:blue}[here | https://wikis.mit.edu/confluence/display/WSWG/How+to+create+a+Trusted+Server+Java+keystore]{color} for instructions on how to create a trusted server Java keystore.\\
\\
* the pom.xml configuration below has been verified to work with the Maven cli and with the Netbeans IDE.\\


1. The Configuration of pom.xml

Panel

To generate java code using the uaws 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:

Code Block
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
        <execution>
            <id>generate java code from wsdl</id>
            <phase>generate-sources</phase>
            <configuration>
                <tasks>
                    <property name="service.wsdl" value="https://mapws.mit.edu/uaws/services/ua?wsdl"/>
                    <property name="server.truststore" value="/path/to/keystore/<the name of your Trused Servers keystore>.jks" />
                    <property name="client.keystore" value="/path/to/keystore/<the name of your application certificate keystore>.jks." />
                    <property name="compile_classpath" refid="maven.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="<clientKeystorePassword>" />
                        <sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
                        <sysproperty key="javax.net.ssl.trustStore" value="${server.truststore}" />
                        <sysproperty key="javax.net.ssl.trustStorePassword" value="<trustStorePassword>" />
                        <sysproperty key="javax.net.ssl.trustStoreType" value="jks" />
                        <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>
indent
1
1
Where in the above:
indent
2
2
Replace {color:green}/path/to/keystore/<the name of your Trused Servers keystore>.jks{color} with the path to and name of the Trusted Servers keystore.
Replace {color:green}/path/to/keystore/<the name of your Trused Servers keystore>.jks{color} with the path to and name of the Applicaiton Certificate keystore.
Replace {color:green}<trustStorePassword>{color} with the password for your {color:green}<the name of your Trusted Servers keystore>{color}.jks.
Replace {color:green}<clientKeystorePassword>{color} with the password for your {color:green}<the name of your Application Certificate keystore>{color}.jks.
indent
1
1
The above plug-in can be used to build the Java code from any of the ISDA supported web services.  You only have to replace the property value of *service.wsdl* with any of the URL's shown below.\\
\\
For example, if you wish to build the Java code for the moiraws web service from the DSPS Production servers, change the line:
indent
2
2
<property name="service.wsdl" value="https://mapws.mit.edu/uaws/services/ua?wsdl"/>
indent
1
1
to:
indent
2
2
<property name="service.wsdl" value="https://mapws.mit.edu/moiraws/services/moira?wsdl"/>
indent
1
1
Note: with the above plug-in configuration, maven will generate java code during generate-source phase.
Panel

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

indent
*Testing Servers:*\\
indent
2
2
* https://ws-test.mit.edu/geows/services/geo?wsdl
* https://ws-test.mit.edu/mitidws/services/mitid?wsdl
* https://ws-test.mit.edu/moiraws/services/moira?wsdl
* https://ws-test.mit.edu/uaws/services/ua?wsdl
indent
*Staging Servers:*\\
indent
2
2
* https://ws-stage.mit.edu/geows/services/geo?wsdl
* https://ws-stage.mit.edu/mitidws/services/mitid?wsdl
* https://ws-stage.mit.edu/moiraws/services/moira?wsdl
* https://ws-stage.mit.edu/uaws/services/ua?wsdl
indent
*Production servers:*
indent
2
2
* https://geows.mit.edu/geows/services/geo?wsdl
* https://mitidws.mit.edu/mitidws/services/mitid?wsdl
* https://moiraws.mit.edu/moiraws/services/moira?wsdl
* https://uaws.mit.edu/uaws/services/ua?wsdl