Hello everybody,

I'm trying to use the "module:request:inputStream" source as described in http://wiki.apache.org/cocoon/ModuleSource to get the the full content of a request (an XML).


I'm using the stream example that came with cocoon (cocoon/samples/stream/process-order), and I have edited the sitemap to call a flowscript function:


   <map:match pattern="process-order">
     <map:generate type="stream">
       <map:parameter name="defaultContentType" value="text/xml"/>
       <map:parameter name="form-name" value="Foo"/>
     </map:generate>
     <map:call function="getRequestBodyDocument">
     </map:call>
...

However, it doesn't work as planned. The cocoon.request.getContentLength() returns a non-zero value (2526), but the inputStream source's getContentLength() returns -1, and the stream returns an empty string. Flowscript code:

cocoon.log.info("Content length: "+cocoon.request.getContentLength()); // Logs 2526
var resolver = null;
var source = null;
try {
resolver = cocoon.getComponent( SourceResolver.ROLE );
source = resolver.resolveURI("module:request:inputStream");
var is = source.getInputStream();
cocoon.log.info("Content length: "+source.getContentLength()); // Logs -1, is.available() returns 0
...


Does anyone have a clue why the inputStream source is empty?

Thanks in advance for your help,

Rune


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



Reply via email to