Search code examples
spring-wsws-securitywss4j

In Spring-WS, while using WS-SecurityPolicy, how do I specify strict layout?


I am trying to consume a web-service exposed by Websphere with WS-SecurityPolicy and strict layout. SOAP generated by Spring-WS client fails against due to layout ordering.

The exact error is this (I am using time-stamp, with encryption and signing) :

Signature for timestamp found ahead of timestamp. Strict Layout not followed in incoming message.

I am using Wss4jSecurityInterceptor. But I could not find a WSS4J property to enforce a strict layout.

Update : I found a similar query raised in Spring forum here. There is no response to that query.


Solution

  • Spring Web-service (latest release uses WSS4J 1.6.5) doesn't expose any property for changing the layout. I had to add an interceptor to programmatically move around time-stamp node in the soap message after the WSS4J call in Wss4jSecurityInterceptor.