Note
Problem: XwsSecurityInterceptor has been deprecated from Spring Boot Version >= 3.0.x
The following are the guidelines/steps for resolving the issue from Spring Boot 3.x.x
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
import org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor; // import this
@Bean
public Wss4jSecurityInterceptor securityInterceptor() {
Wss4jSecurityInterceptor securityInterceptor = new Wss4jSecurityInterceptor();
securityInterceptor.setSecurementActions("UsernameToken");
securityInterceptor.setValidationCallbackHandler(callbackHandler());
return securityInterceptor;
}
Step 3: Modify SimplePasswordValidationCallbackHandler
package namespace(xwss -> wss4j2) and add the following bean
import org.springframework.ws.soap.security.wss4j2.callback.SimplePasswordValidationCallbackHandler;
@Bean
public SimplePasswordValidationCallbackHandler callbackHandler() {
SimplePasswordValidationCallbackHandler handler = new SimplePasswordValidationCallbackHandler();
handler.setUsersMap(Collections.singletonMap("user", "password"));
return handler;
}
Happy Learning @in28minutes