Tweak Airline Spring-WS client.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -29,8 +29,5 @@ public class SpringWsMain {
|
||||
|
||||
GetFlights getFlights = ctx.getBean(GetFlights.class);
|
||||
getFlights.getFlights();
|
||||
|
||||
GetFrequentFlyerMileage getFrequentFlyerMileage = ctx.getBean(GetFrequentFlyerMileage.class);
|
||||
getFrequentFlyerMileage.getFrequentFlyerMileage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user