This is not possible at the Axiom level. The reason is that at the time you get the SOAPEnvelope object, the underlying StAX parser has already consumed part of the stream. Also, since the purpose of Axiom is to enable streaming and deferred parsing, it doesn't keep a copy of the original stream.
Andreas On Wed, Aug 25, 2010 at 12:20, Cappa Roberto <[email protected]> wrote: > Hi, I'm developing a custom Axis2 handler and I need to print a SOAP message > to log, in my code I have only a reference to the SOAPEnvelope axiom object. > > The problem is that if I try to do this: > > SOAPEnvelope env = //Retrieve from Axis2 message Context > log.debug(env.toString()); > > If the XML is not well formed I obtain an exception, because the toString() > tries to parse the XML. My handler needs to print the original stream, also > if it is not well formed (this is the logging purpouse). > > Unfortunately I cannot retrieve the original stram from Axis2 and I'm > wondering if I can obtain it from Axiom APIs, WITHOUT start the parsing > process. Is there a way to retrieve the original inputstream, that was used > to create the Axiom parser, having only the SOAPEnvelope reference? > > Thanks >
