Tweak Airline Spring-WS client.

This commit is contained in:
Greg L. Turnquist
2022-11-29 12:48:50 -06:00
parent 3f70191389
commit 404fc0f34b
5 changed files with 1 additions and 59 deletions

View File

@@ -17,11 +17,8 @@
<description>Demo project for Spring Web Services</description>
<properties>
<java.version>1.8</java.version>
<jax-ws.version>2.1.7</jax-ws.version>
<log4j2.version>2.15.0</log4j2.version>
<xmlbeans.version>2.4.0</xmlbeans.version>
<xws.version>3.0</xws.version>
<sourcesDir>${project.basedir}/target/generated-sources/xjc</sourcesDir>
<classesDir>${project.basedir}/target/classes</classesDir>
<schema>${project.basedir}/../../server/src/main/resources</schema>
@@ -35,38 +32,6 @@
<artifactId>spring-ws-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<exclusions>
<exclusion>
<groupId>com.sun.xml.wsit</groupId>
<artifactId>wsit-rt</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.wsit</groupId>
<artifactId>xws-security</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.xml.wss</groupId>
<artifactId>xws-security</artifactId>
<version>${xws.version}</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>javax.xml.crypto</groupId>
<artifactId>xmldsig</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-test</artifactId>

View File

@@ -29,8 +29,5 @@ public class SpringWsMain {
GetFlights getFlights = ctx.getBean(GetFlights.class);
getFlights.getFlights();
GetFrequentFlyerMileage getFrequentFlyerMileage = ctx.getBean(GetFrequentFlyerMileage.class);
getFrequentFlyerMileage.getFrequentFlyerMileage();
}
}

View File

@@ -5,7 +5,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
import org.springframework.ws.soap.SoapMessageFactory;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor;
@Configuration(proxyBeanMethods = false)
public class WsConfiguration {
@@ -34,23 +33,10 @@ public class WsConfiguration {
}
@Bean
GetFrequentFlyerMileage getFrequentFlyerMileage(SoapMessageFactory messageFactory,
Wss4jSecurityInterceptor securityInterceptor) {
GetFrequentFlyerMileage getFrequentFlyerMileage(SoapMessageFactory messageFactory) {
GetFrequentFlyerMileage getFrequentFlyerMileage = new GetFrequentFlyerMileage(messageFactory);
getFrequentFlyerMileage.setDefaultUri("http://localhost:8080/airline-server/services");
getFrequentFlyerMileage.setInterceptors(new Wss4jSecurityInterceptor[] { securityInterceptor });
return getFrequentFlyerMileage;
}
@Bean
Wss4jSecurityInterceptor securityInterceptor() {
Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
interceptor.setSecurementActions("UsernameToken");
interceptor.setSecurementUsername("john");
interceptor.setSecurementPassword("changeme");
return interceptor;
}
}

View File

@@ -1,3 +0,0 @@
<xwss:SecurityConfiguration dumpMessages="false" xmlns:xwss="https://java.sun.com/xml/ns/xwss/config">
<xwss:UsernameToken digestPassword="true" useNonce="true"/>
</xwss:SecurityConfiguration>

View File

@@ -1,3 +0,0 @@
<xwss:SecurityConfiguration dumpMessages="false" xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:RequireUsernameToken passwordDigestRequired="true" nonceRequired="true"/>
</xwss:SecurityConfiguration>