Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 24956 invoked from network); 16 Aug 2005 00:26:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2005 00:26:26 -0000 Received: (qmail 45151 invoked by uid 500); 16 Aug 2005 00:26:23 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 45124 invoked by uid 500); 16 Aug 2005 00:26:23 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 45111 invoked by uid 99); 16 Aug 2005 00:26:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 17:26:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [63.100.100.166] (HELO outhub3.tibco.com) (63.100.100.166) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 17:26:42 -0700 Received: from na-h-inhub1.tibco.com (na-h-inhub1 [10.106.128.33]) by outhub3.tibco.com (8.12.10/8.12.9) with ESMTP id j7G0QKhD000108 for ; Mon, 15 Aug 2005 17:26:20 -0700 (PDT) Received: from nsmail3.tibco.com (nsmail3.tibco.com [10.106.128.35]) by na-h-inhub1.tibco.com (8.12.10/8.12.10) with ESMTP id j7G0QKd1022003 for ; Mon, 15 Aug 2005 17:26:20 -0700 (PDT) Received: from [10.101.3.237] (dhcp-3-237.rv.tibco.com [10.101.3.237]) by mail3.tibco.com (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with ESMTP id <0ILA0031XH7WDH@mail3.tibco.com> for axis-dev@ws.apache.org; Mon, 15 Aug 2005 17:26:20 -0700 (PDT) Date: Mon, 15 Aug 2005 17:26:19 -0700 From: Eric Johnson Subject: Re: svn commit: r232390 - /webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java In-reply-to: To: axis-dev@ws.apache.org Message-id: <430132AB.8080909@tibco.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050725) References: <20050812205346.37472.qmail@minotaur.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 * > > wrote: > > Author: dims > Date: Fri Aug 12 13:53:43 2005 > New Revision: 232390 > > URL: 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 > > ============================================================================== > > --- > 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 >