Spring WS Intercept Request Response Soap Messages

You may also like...

3
Leave a Reply

avatar
3 Comment threads
0 Thread replies
3 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
Robert OschwaldRyanRaghu Kishore Kasturi Recent comment authors
  Subscribe  
newest oldest
Notify of
Raghu Kishore Kasturi
Guest
Raghu Kishore Kasturi

Thank you!

Ryan
Guest
Ryan

Thanks so much. It helped me tackling the problem.

Robert Oschwald
Guest
Robert Oschwald

In Spring-WS-Core 2.4.x, it doesn’t work this way anymore. It seems SmartInterceptors are obtained by their bean type, not in the interceptor array anymore.

So define PayloadRootSmartSoapEndpointInterceptor just as beans.

@Bean
PayloadValidatingInterceptor myEndpointValidatingInterceptor() {
PayloadValidatingInterceptor interceptor = new PayloadValidatingInterceptor()
interceptor.schema = new ClasspathResource(MyEndpoint.SCHEMA_FILE_NAME)
interceptor.validateRequest = true
interceptor.validateResponse = true
return interceptor
}

// Per Endpoint Namespace validator. Obtained by type.
@Bean
PayloadRootSmartSoapEndpointInterceptor myEndpointValidator() {
return new PayloadRootSmartSoapEndpointInterceptor(myEndpointValidatingInterceptor(), MyEndpoint.NAMESPACE_URI, null)
}