Build JAX-WS airline client module with Spring WS 4.0.

This commit is contained in:
Greg L. Turnquist
2022-11-17 16:35:29 -06:00
parent bd9296e632
commit de4620ca41
3 changed files with 48 additions and 71 deletions

View File

@@ -31,63 +31,45 @@
<dependency> <dependency>
<groupId>org.springframework.ws</groupId> <groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId> <artifactId>spring-ws-core</artifactId>
<!-- <version>${spring-ws.version}</version>-->
</dependency> </dependency>
</dependencies> <dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>${jaxws-tools.version}</version>
</dependency>
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>${jws-api.version}</version>
</dependency>
</dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>com.sun.xml.ws</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>jaxws-maven-plugin</artifactId>
<version>1.8</version> <version>3.0.0</version>
<dependencies> <executions>
<dependency> <execution>
<groupId>com.sun.xml.ws</groupId> <goals>
<artifactId>jaxws-tools</artifactId> <goal>wsimport</goal>
<version>${jax-ws.version}</version> </goals>
</dependency> </execution>
<dependency> </executions>
<groupId>com.sun</groupId> <configuration>
<artifactId>tools</artifactId> <!-- The name of your generated source package -->
<version>1.5.0</version> <wsdlFiles>${project.basedir}/../airline.wsdl</wsdlFiles>
<scope>system</scope> <packageName>org.springframework.ws.samples.airline.client.jaxws</packageName>
<systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath> <sourceDestDir>${sourcesDir}</sourceDestDir>
</dependency> <destDir>${classesDir}</destDir>
</dependencies> <extension>true</extension>
<executions> </configuration>
<execution> </plugin>
<phase>generate-sources</phase>
<configuration>
<tasks>
<taskdef name="wsimport"
classname="com.sun.tools.ws.ant.WsImport">
<classpath refid="maven.compile.classpath"/>
</taskdef>
<mkdir dir="${sourcesDir}" />
<mkdir dir="${classesDir}" />
<wsimport
destdir="${classesDir}"
sourcedestdir="${sourcesDir}"
keep="true"
verbose="true"
extension="true"
wsdl="${wsdl}"
package="org.springframework.ws.samples.airline.client.jaxws">
<produces dir="${classesDir}" includes="**/*.class" />
</wsimport>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>

View File

@@ -16,6 +16,8 @@
package org.springframework.ws.samples.airline.client.jaxws; package org.springframework.ws.samples.airline.client.jaxws;
import jakarta.xml.ws.soap.SOAPFaultException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
@@ -24,7 +26,6 @@ import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.ws.soap.SOAPFaultException;
/** /**
* Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code> operations using JAX-WS. * Simple client that calls the <code>GetFlights</code> and <code>BookFlight</code> operations using JAX-WS.

32
pom.xml
View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.4</version> <version>3.0.0-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
@@ -42,13 +42,22 @@
</license> </license>
</licenses> </licenses>
<properties>
<java.version>17</java.version>
<jaxws-tools.version>3.0.1</jaxws-tools.version>
<jws-api.version>3.0.0</jws-api.version>
<sourcesDir>${project.basedir}/target/generated-sources/jaxws</sourcesDir>
<classesDir>${project.basedir}/target/classes</classesDir>
<wsdl>${project.basedir}/airline/client/airline.wsdl</wsdl>
</properties>
<modules> <modules>
<module>airline/client/axis1</module> <!-- <module>airline/client/axis1</module>-->
<module>airline/client/jax-ws</module> <module>airline/client/jax-ws</module>
<module>airline/client/jms</module> <!-- <module>airline/client/jms</module>-->
<module>airline/client/saaj</module> <module>airline/client/saaj</module>
<module>airline/client/spring-ws</module> <module>airline/client/spring-ws</module>
<module>airline/server</module> <!-- <module>airline/server</module>-->
<module>echo/client/saaj</module> <module>echo/client/saaj</module>
<module>echo/client/spring-ws</module> <module>echo/client/spring-ws</module>
<module>echo/server</module> <module>echo/server</module>
@@ -57,21 +66,6 @@
<module>tutorial</module> <module>tutorial</module>
</modules> </modules>
<profiles>
<profile>
<id>spring-ws-3.1-snapshots</id>
<properties>
<spring-ws.version>3.1.4-SNAPSHOT</spring-ws.version>
</properties>
</profile>
<profile>
<id>spring-ws-3.2</id>
<properties>
<spring-ws.version>3.2.0-SNAPSHOT</spring-ws.version>
</properties>
</profile>
</profiles>
<dependencies> <dependencies>
<dependency> <dependency>