axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Davis" <...@us.ibm.com>
Subject Re: cvs commit: xml-axis/java/src/org/apache/axis Message.java
Date Wed, 21 Feb 2001 21:04:09 GMT
Is this going to kill the idea of streaming?  Seems like a read problem
if we can't leave it as an InputStream.
-Dug

gdaniels@apache.org on 02/21/2001 02:18:34 PM

Please respond to axis-dev@xml.apache.org

To:   xml-axis-cvs@apache.org
cc:
Subject:  cvs commit: xml-axis/java/src/org/apache/axis Message.java



gdaniels    01/02/21 11:18:32

  Modified:    java/src/org/apache/axis Message.java
  Log:
  Read in the characters from the Servlet's InputStream into a char array,
  as was done by v2.1, instead of using the InputStream directly for XML
  parsing.  This works around some kind of interaction bug between
  Xerces and JRun where no Servlet output was produced.  Need to
  track this and resolve it for real in the future.

  Revision  Changes    Path
  1.10      +15 -3     xml-axis/java/src/org/apache/axis/Message.java

  Index: Message.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Message.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Message.java  2001/02/10 04:39:53  1.9
  +++ Message.java  2001/02/21 19:18:28  1.10
  @@ -68,6 +68,7 @@
   /**
    *
    * @author Doug Davis (dug@us.ibm.com)
  + * @author Glen Daniels (gdaniels@allaire.com)
    */
   public class Message {
     /**
  @@ -211,9 +212,20 @@
       try {
         if ( currentForm.equals("InputStream") )
           reader = new InputStreamReader( (InputStream) currentMessage );
  -      else if ( currentForm.equals("ServletRequest") )
  -        reader = new InputStreamReader( ((HttpServletRequest)
currentMessage).
  -                                        getInputStream() );
  +      else if ( currentForm.equals("ServletRequest") ) {
  +        HttpServletRequest req = (HttpServletRequest)currentMessage;
  +
  +        int contentLength = req.getContentLength();
  +        Reader requestReader = req.getReader ();
  +        char[] payload       = new char[contentLength];
  +        int    offset        = 0;
  +
  +        while (offset < contentLength) {
  +            offset += requestReader.read (payload, offset, contentLength
- offset);
  +        }
  +
  +        reader = new CharArrayReader(payload);
  +      }
         else if ( currentForm.equals("String") )
           reader = new StringReader( (String) currentMessage );
         else if ( currentForm.equals("Bytes") )  {






Mime
View raw message