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.
...
Panel |
---|
Before you begin, you must have the following: indent |
---|
|
* an application certificate Java keystore. |
If you do not have an application certificate Java keystore, click {color:blue}[here | https://wikis-mit-edu.ezproxyberklee.flo.org/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 here 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.\\
\\
* a trusted server Java keystore.
If you do not have a Trusted Server Java keystore, click {color:blue}[here | https://wikis-mit-edu.ezproxyberklee.flo.org/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.ezproxyberklee.flo.org/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>
| Where in the indent |
---|
|
Where in the above:
|
indent |
---|
|
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 |
---|
|
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 \\
\\
For example, if you wish to build the Java code for the moiraws web service from the DSPS Production servers, change the line: | <property indent |
---|
|
<property name="service.wsdl" value="https://mapws-mit-edu.ezproxyberklee.flo.org/uaws/services/ua?wsdl"/> | <property indent |
---|
|
<property name="service.wsdl" value="https://mapws-mit-edu.ezproxyberklee.flo.org/moiraws/services/moira?wsdl"/>
|
indent |
---|
|
Note: with the above plug-in configuration, maven will generate java code during generate-source phase.
|
|