On Thursday 15 July 2010 11:52:02 am Mishkin, Ernest wrote:
> Glen, thanks for the response.
> I think I can determine the right phase; looks like my question is
> what's the most elegant way to capture the bytes comprising SOAP message
> about to be sent across the wire?
> Is the LogginInterceptor-like solution with replacing message's
> OutputStream with a decorated one that "caches" the bytes as they're
> written to it the only way?

Pretty much yes.   Under normal circumstances, we stream directly to the wire 
so the message never exists as a byte[] or String or anything.   Thus, you 
would need to do the wrapper thing to get it.

The other alternative would be the SAAJOutInterceptor stuff that would buffer 
the message as a DOM/SAAJ model.    You could then use that to write it out 
however you want.     In general, the OutputStream thing would perform a bit 
better though (normally) unless there is some reason to already have the SAAJ 
stuff there (such as WS-Security).

Dan


> When I check message.getContentFormats() I always get
> [class java.io.OutputStream, interface javax.xml.stream.XMLStreamWriter,
> interface java.util.List]
> which doesn't allow me to grab the bytes/string easily.
> 
> > Maybe the PRE_INVOKE phase:
> > http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors
> > 
> > Glen
> 
> --------------------------------------------------------
> 
> The information contained in this message is intended only for the
> recipient, and may be a confidential attorney-client communication or may
> otherwise be privileged and confidential and protected from disclosure. If
> the reader of this message is not the intended recipient, or an employee
> or agent responsible for delivering this message to the intended
> recipient, please be aware that any dissemination or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please immediately notify us by replying to the
> message and deleting it from your computer. The McGraw-Hill Companies,
> Inc. reserves the right, subject to applicable local law, to monitor and
> review the content of any electronic message or information sent to or
> from McGraw-Hill employee e-mail addresses without informing the sender or
> recipient of the message.
> --------------------------------------------------------

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

Reply via email to