axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Johnson <e...@tibco.com>
Subject Re: svn commit: r232390 - /webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
Date Tue, 16 Aug 2005 00:26:19 GMT
HttpClient doesn't compute content length - unless you give it a String 
to send, and the appropriate encoding, in which case it converts the 
String to bytes and gets the length.  Of course, if you give it a byte 
array, it can simply ask the byte array how long it is.

HttpClient deals in "RequestEntity" implementations, and that has only 
four methods:  isRepeatable(), writeContent(), getContentLength(), 
getContentType().  There are, of course, default implementations for 
InputStreams, Strings, and byte arrays.

The best that HttpClient can do, if the length is unknown, is to send 
the request with "chunked" encoding.

-Eric.

Thilina Gunarathne wrote:

> IMHO it's If it's sending the wrong size it should be a bug in Commons 
> HttpClient. It's suppose to compute the content-length regardless 
> whether the data are binary, text , MIME or anything....
>  
> Thanks,
> ~Thilina
>
>  
> On 8/13/05, *dims@apache.org <mailto:dims@apache.org>* 
> <dims@apache.org <mailto:dims@apache.org>> wrote:
>
>     Author: dims
>     Date: Fri Aug 12 13:53:43 2005
>     New Revision: 232390
>
>     URL: http://svn.apache.org/viewcvs?rev=232390&view=rev
>     <http://svn.apache.org/viewcvs?rev=232390&view=rev>
>     Log:
>     don't compute the size if we are using mtom (use chunking). This
>     is better than sending the wrong size.
>
>
>     Modified:
>       
>     webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
>
>
>     Modified:
>     webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
>     URL:
>     http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=232390&r1=232389&r2=232390&view=diff
>     <http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=232390&r1=232389&r2=232390&view=diff>
>     ==============================================================================
>
>     ---
>     webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
>     (original)
>     +++
>     webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
>     Fri Aug 12 13:53:43 2005
>     @@ -271,7 +271,7 @@
>
>             public long getContentLength() {
>                 try {
>     -                if (chuncked) {
>     +                if (chuncked || doingMTOM) {
>                         return -1;
>                     } else {
>                         if (bytes == null) {
>
>
>
>
>
> -- 
> "May the SourcE be with u"
> http://www.bloglines.com/blog/thilina 
> <http://www.bloglines.com/blog/thilina> 


Mime
View raw message