Thanks for your help!
Before i read your reply, i did a workaround and wrote a handler.
But to prove your solution, I just rewrote my interceptors.

It was enough to use

super( Phase.POST_PROTOCOL );
addBefore( WSS4JOutInterceptor.class.getName() );

in the constructor of my out-interceptor.
My corresponding in-interceptor is constructed using

super(Phase.PRE_PROTOCOL);
getAfter().add(WSS4JInInterceptor.class.getName());

This gives me the decrypted message ready for logging (or whatever).
Now as I got them working, I will stick to the interceptors and drop the
handler.

Greetings

Björn


dkulp wrote:
> 
> 
> This would be a bit tricky.   If you are using the WSS4JOutInterceptor,
> the 
> non-encrypted stuff would NEVER be in "stream" form.
> 
> Most likely, what you need to do is write an interceptor that goes in the:
> Phase.POST_PROTOCOL;
> phase, but is before the 
> WSS4JOutInterceptorInternal.class.getName()
> interceptor.  (could probably do "setBefore("*");"
> 
> In that interceptor, you should be able to do:
> SOAPMessage saaj = mc.getContent(SOAPMessage.class);
> to get it in SAAJ form, but prior to encryption.  You could then log that 
> anyway you want.
> 
> Dan
> 
> 
> 
> On Tuesday 16 December 2008 5:48:02 am bschuette wrote:
>> I have a similar problem, I need to log all outgoing messages before they
>> are encrypted and signed.
>> I tried to modify the shipped LoggingOutInterceptor within its
>> constructor:
>>
>> super( Phase.PRE_STREAM );
>> addBefore( StaxOutInterceptor.class.getName() );
>> addBefore( WSS4JOutInterceptor.class.getName() );
>>
>>
>> This does not seem to help. I have tried to use earlier phases with no
>> luck. I guess it has something to do with the callback mechanism and the
>> caching used by this interceptor?
>>
>> Any hints how I could solve my problem?
>>
>> Thanks!
>>
>> Björn
>>
>> dkulp wrote:
>> > On Monday 15 December 2008 1:41:03 pm Curious Mind wrote:
>> >> I have gone through that example and didnt found of much use. Anyways
>> I
>> >> have achieved my target using handler but I still think Interceptor
>> >> would have be better option. I really need example which can show how
>> to
>> >> play with XML Body Message.
>> >
>> > It kind of depends on what type of modifications you need to make.
>> >
>> > If you really need to make large structural modifications (kind of like
>> > ws-security that is encrypting things, adding headers, etc...), you
>> would
>> > probably use the SAAJOutInterceptor+YouInterceptor to work on the saaj
>> > model.
>> > Fairly similar to the JAX-WS handlers.
>> >
>> > If the modification can be done in a streaming manner (like namespace
>> > mapping
>> > or adding an element/attribute or similar), you would normally use an
>> > interceptor that would wrapper/replace the XMLStreamWriter or even the
>> > OutputStream with a  new one that does the behavior you need.
>> >
>> > --
>> > Daniel Kulp
>> > [email protected]
>> > http://dankulp.com/blog
> 
> 
> 
> -- 
> Daniel Kulp
> [email protected]
> http://dankulp.com/blog
> 
> 

-- 
View this message in context: 
http://www.nabble.com/XML-Response-modification-tp20990405p21051562.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to