You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Gawde, Kiran" <Ki...@schwab.com> on 2005/03/03 03:07:08 UTC

SOAPHelper

A suggestion for dev team:
 
The SOAPHelper.java retrieves entire webservice respose and then returns
XScriptObjectInlineXML. 
            String ret = method.getResponseBodyAsString();
            int startOfXML = ret.indexOf("<?xml");
            if (startOfXML == -1) { // No xml?!
                throw new ProcessingException("Invalid response - no xml");
            }
            return new XScriptObjectInlineXML(
                    xscriptManager,
                    ret.substring(startOfXML));

If the webservices response is large, this could exhaust all the VM memory.
 
It is better to create some other subclass of XScriptObject which can take
InputStream. Then SoapHelper can return the output of
method.getResponseAsStream().
 
Regards,
Kiran Gawde
Senior Software Engineer, Object Edge Inc.
http://www.objectedge.com <http://www.objectedge.com/>