dev@jax-ws.java.net

Re: implementing XMLStreamReaderEx.getPCData

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 09 Feb 2006 17:51:24 +0100

Vivek Pandey wrote:
> I am trying to implement XMLStreamReaderEx.getPCData() to de-reference
> the xop refererences by base64 encoding the binary attachments.
>
> I am trying to use XMLStreamBuffer for this purpose, following is the code:
>
> XMLStreamReader xmlreader =
> XMLStreamReaderFactory.createXMLStreamReader(is, true);
> XMLStreamBuffer sb = new XMLStreamBuffer();
> sb.createFromXMLStreamReader(xmlreader);
> reader= sb.processUsingStreamReaderBufferProcessor();
>
> I use the reader in getPCData(). Would you know whats the best way to
> transform the underlying xml infoset stream into byte stream while
> resolving xop reverefences - is the only way out is SAX or something else?
>

I am missing the bigger picture here so I do not understand why you need
  to buffer the XML attachment part.

Can't an MTOM XMLStreamReader impl adapt another XMLStreamReader
instance (its impl does not matter) and check for XOP elements as it reads?

As i understand this can be performed in a streaming fashion (in terms
of infoset but necessarily in terms of attachment parts).


> Another question - XMLStreamReader.reset() - when should we call this in
> StreamSOAPDecoder - as the last thing in decode()?
>

At the start makes more logical sense to me, but either the start or end
would do. Because we have to make sure we work with other XML StAX
implementations we have to use the reflected method and defer to the
factory if not our implementation, like in the old code.

Also we need to make this work with FI, but we can work this out after.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109