axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/transport/http HTTPDispatchHandler.java
Date Thu, 03 May 2001 03:43:59 GMT
rubys       01/05/02 20:43:59

  Modified:    java/src/org/apache/axis/transport/http
                        HTTPDispatchHandler.java
  Log:
  Client intermittently truncates the response, also some client side
  performance improvements.
  
  Revision  Changes    Path
  1.18      +20 -7     xml-axis/java/src/org/apache/axis/transport/http/HTTPDispatchHandler.java
  
  Index: HTTPDispatchHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/HTTPDispatchHandler.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- HTTPDispatchHandler.java	2001/04/27 15:24:33	1.17
  +++ HTTPDispatchHandler.java	2001/05/03 03:43:59	1.18
  @@ -65,6 +65,7 @@
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeader;
   import org.apache.axis.handlers.BasicHandler;
  +import org.apache.axis.transport.http.NonBlockingBufferedInputStream;
   import org.apache.axis.encoding.Base64 ;
   
   import org.w3c.dom.* ;
  @@ -168,8 +169,8 @@
         
         //System.out.println("Msg: " + reqEnv);
   
  +      BufferedInputStream inp = new BufferedInputStream(sock.getInputStream());
         OutputStream  out  = sock.getOutputStream();
  -      InputStream   inp  = sock.getInputStream();
         StringBuffer  otherHeaders = new StringBuffer();
         String        userID = null ;
         String        passwd = null ;
  @@ -253,7 +254,7 @@
                                       name.substring(end+1));
             }
             else
  -            headers.put( name, value );
  +            headers.put( name.toLowerCase(), value );
             len = 0 ;
           }
         }
  @@ -268,12 +269,24 @@
         }
   
         if ( b != -1 ) {
  -        outMsg = new Message( inp, "InputStream" );
  -        msgContext.setResponseMessage( outMsg );
  +
  +        if (Debug.getDebugLevel() > 0) {
  +          String contentLength = (String) headers.get("content-length");
  +          byte[] data = new byte[Integer.parseInt(contentLength)];
  +          for (len=0; len<data.length; )
  +            len+= inp.read(data,len,data.length-len);
  +          String xml = new String(data);
  +
  +          outMsg = new Message( data, "String" );
  +
  +          Debug.Print( 1, "\nXML received:" );
  +          Debug.Print( 1, "-------------------------------------------------");
  +          Debug.Print( 1, xml );
  +        } else {
  +          outMsg = new Message( inp, "InputStream" );
  +        }
   
  -        Debug.Print( 1, "\nXML received:" );
  -        Debug.Print( 1, "---------------------------------------------------");
  -        Debug.Print( 1, (String)outMsg.getAs("String") );
  +        msgContext.setResponseMessage( outMsg );
         }
         inp.close();
         out.close();
  
  
  

Mime
View raw message