cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PlanetCocoon Users Forum <>
Subject [Forum] Problems using the module:request:inputStream source in flowscript
Date Fri, 20 May 2005 11:24:44 GMT
Hello everybody,

I'm trying to use the "module:request:inputStream" source as described 
in 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:call function="getRequestBodyDocument">

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:"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();"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,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message