Hi

I want to read a large ( > 4MB .. typically upto or over 10MB) text file and create an OMTextNode to hold its contents. This is because within Apache Synapse I may do an XSLT transform over a huge payload that generates say a CSV output of a few megabytes. Now I keep this within a OMText node within the SOAP envelope.

If I try to read the file into a String/StringBuffer I run out of heap memory (most often).. and thus I want to use the OMFactory.createOMText(DataHandler, boolean) method to overcome this.

           FileDataSource fileDataSource = new FileDataSource(file);
           OMTextImpl textData =
(OMTextImpl) fac.createOMText(new DataHandler(fileDataSource), false); wrapper = fac.createOMElement(BaseConstants.DEFAULT_TEXT_WRAPPER, null);
           wrapper.addChild(textData);

But what gets stored into the OMText is the text file probably read in as Base64!.. Is this the intended behavior of this method or am I doing something wrong? How should I be reading a huge text file into an OMText node?

thanks
asankha


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to