I had to create a Java client that calls a “secured” (WS-Security standards) SOAP 1.1 webservice. I chose to use the latest version of Spring-WS to do so.
org.springframework.boot:spring-boot-starter-ws (implied version 2.2.3.RELEASE)
org.springframework.ws:spring-ws-security (implied version 2.2.3.RELEASE)
The security part of the SOAP request I need to generate looks like this:
Below is the way to generate a SOAP request like the one above. It uses
Wss4jSecurityInterceptor Spring interceptor
Then you have to add this interceptor to your webservice template configuration:
If you have any issue, feel free to contact me.