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

Reply via email to