You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Steven Bixby <St...@inovis.com> on 2007/12/12 21:02:13 UTC

XFire->CXF migration question

My project has been stably using XFire 1.2.6 for a few months and I'm
exploring the migration to CXF.

One sticking point I can't seem to figure out yet is how to replace an
XFire AbstractHandler implementation we have - our instance uses the
MessageContext to grab the SOAP message DOM object, like this:

   Document doc = (Document) context.getInMessage().
                       getProperty(DOMInHandler.DOM_MESSAGE);

All we do with this is convert the DOM object back to a string and
archive it for logging purposes.

So my goal is, presumably, to create an AbstractPhaseInterceptor that
will be able to grab the SOAP message TEXT from the request, and stash
it somewhere.

I've played around with a number of trial-and-error usages of the
interceptor implementation, but I don't understand how to get at the raw
text or DOM object from the SOAP request.  I've searched the web a fair
bit and haven't seen any examples yet.

Can anyone help?


Steven Bixby
Senior Software Engineer
steven.bixby@inovis.com
1400 Marina Way South
Richmond, CA 94804
www.inovis.com


Re: XFire->CXF migration question

Posted by Daniel Kulp <dk...@apache.org>.
Steven,

For normal operation, we don't build up the SAAJ model.   That's pretty 
expensive and not needed most of the time.

There are a couple options to achieve this:

1)  Configure the SAAJInInterceptor onto the in interceptor chain.   In 
any interceptor that runs after that, you can just do 
msg.getContent(SOAPMessage.class) to get the SOAPMessage object.

2) If all you want is a byte[]/string of the message, look into the 
LoggingInInterceptor.   You could use the code for that as a starting 
point.     (Actually, the code for 2.1 is even better as it can be 
configured with a print stream to log too)

3) You might even be able to use the LoggingInInterceptor directly.   If 
you configure the logging for that Logger to log to a specific file, 
you're possibly done.

Dan

On Wednesday 12 December 2007, Steven Bixby wrote:
> My project has been stably using XFire 1.2.6 for a few months and I'm
> exploring the migration to CXF.
>
> One sticking point I can't seem to figure out yet is how to replace an
> XFire AbstractHandler implementation we have - our instance uses the
> MessageContext to grab the SOAP message DOM object, like this:
>
>    Document doc = (Document) context.getInMessage().
>                        getProperty(DOMInHandler.DOM_MESSAGE);
>
> All we do with this is convert the DOM object back to a string and
> archive it for logging purposes.
>
> So my goal is, presumably, to create an AbstractPhaseInterceptor that
> will be able to grab the SOAP message TEXT from the request, and stash
> it somewhere.
>
> I've played around with a number of trial-and-error usages of the
> interceptor implementation, but I don't understand how to get at the
> raw text or DOM object from the SOAP request.  I've searched the web a
> fair bit and haven't seen any examples yet.
>
> Can anyone help?
>
>
> Steven Bixby
> Senior Software Engineer
> steven.bixby@inovis.com
> 1400 Marina Way South
> Richmond, CA 94804
> www.inovis.com



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog