You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Saniya Afaq <sa...@actividentity.com> on 2008/11/12 01:51:09 UTC
RE: WELCOME to users@cxf.apache.org
Hi,
I'm using Metro 1.3 with JDK 1.5.x.
I need a solution for streaming large messages - currently in my
solution - we stream large messages by using the Provider API -
dispatching the XML file from the client to the server side.
However on the server side we receive a StaxSource object - and it is
not possible to retrieve a stream from that object. I had to do the
following in my code - but it doesn't seem like the right solution since
i do not want to write out all the binary data in memory in the
ByteOutputStream... Does Metro provide some way of going about it -
since the whole purpose of Provider API is to enable us to handle large
messages --
ByteArrayOutputStream bos = new ByteArrayOutputStream();
StreamResult streamResult = new StreamResult(bos);
Transformer trans = TransformerFactory.newInstance().newTransformer();
trans.transform(inSource, streamResult);
bos.close();
ByteArrayInputStream in = new ByteArrayInputStream(bos.toByteArray());
Any help would be great!
Thanks
Saniya