On Wednesday 06 October 2010 7:08:43 pm jaybytez wrote:
> I am using JaxWsProxyFactoryBean for client invocation of a web service.
> 
> We have a requirement to intercept the SOAPEnvelope before it goes out and
> send it to a Secured Token Service, which will return a SOAPEnvelope with
> SAML or Encryption, etc.  And then that returned/secured SOAPEnvelope will
> replace the original and be sent on to the original destination.
> 
> Which phase of the outgoing interceptors is the best phase to do this
> logic?

Well, assuming you cannot just use the WS-SecPolicy and WS-Trust stuff built 
into CXF, the best way to approach this, IMO, would be to:

* Configure in the SAAJOutInterceptor to have the output generate into an SAAJ 
object model

* Add an interceptor that would run in the Phase.PRE_PROTOCOL_ENDING phase 
with an 
addBefore(SAAJOutInterceptor.SAAJOutEndingInterceptor.class.getName());
setting to force it to run immediately before the SAAJOutEndingInterceptor.  
In there, you could grab the SAAJ  model out of the message and modify it all 
you want or replace it.   

Dan



> 
> Thanks for your help,
> 
> Jay Blanton

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to