Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 71389 invoked from network); 21 Mar 2006 09:54:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Mar 2006 09:54:07 -0000 Received: (qmail 49945 invoked by uid 500); 21 Mar 2006 09:54:03 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 49929 invoked by uid 500); 21 Mar 2006 09:54:02 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 49918 invoked by uid 99); 21 Mar 2006 09:54:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Mar 2006 01:54:02 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of r.chaitanya@gmail.com designates 64.233.184.206 as permitted sender) Received: from [64.233.184.206] (HELO wproxy.gmail.com) (64.233.184.206) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Mar 2006 01:54:01 -0800 Received: by wproxy.gmail.com with SMTP id i7so69564wra for ; Tue, 21 Mar 2006 01:53:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TGTDsn/V2f+BnwjK5urQspPldX24CI5lD7WZm4WfRQVTxpeAycVleDyzeEWfiWGENuYRptQIQShfqnRNOD+h/WugVVkaxEQI+SvEL3exVcy9H3rJTmfUlPMpkEjjbqixMecJrmOD6uhE6t+w7fmALzPoHxw4F0+tBxIXTXEds1s= Received: by 10.54.104.5 with SMTP id b5mr271385wrc; Tue, 21 Mar 2006 01:53:40 -0800 (PST) Received: by 10.54.81.11 with HTTP; Tue, 21 Mar 2006 01:53:40 -0800 (PST) Message-ID: <44228ab10603210153h6172bfbdv81e1fa77b2a6823e@mail.gmail.com> Date: Tue, 21 Mar 2006 15:23:40 +0530 From: "Chaitanya Ravi" To: "HttpClient User Discussion" Subject: Re: Warning message? In-Reply-To: <44228ab10603210033y50c9d3a6vaa629c134abda514@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2590_19614593.1142934820875" References: <000301c649ee$0fc1a1b0$8119fea9@bbm> <44477CE2.1030502@free.fr> <1142863943.8397.26.camel@localhost.localdomain> <44479F25.7020301@free.fr> <1142877407.8397.42.camel@localhost.localdomain> <4447C293.4060304@free.fr> <1142879585.8397.46.camel@localhost.localdomain> <4447CD24.2050605@free.fr> <5.0.2.1.2.20060321134024.02155d70@pop.cbn.net.id> <44228ab10603210033y50c9d3a6vaa629c134abda514@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2590_19614593.1142934820875 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Ricky, But the warning message suggest you to use getResponseBodyAsStream. Replace reply =3D method.getResponseBody() with below lines: InputStream is =3D postMethod.getResponseBodyAsStream(); BufferedInputStream bis =3D new BufferedInputStream( is ); String datastr =3D null; StringBuffer sb =3D new StringBuffer(); byte[] bytes =3D new byte[ 8192 ]; // reading as chunk of 8192 bytes int count =3D bis.read( bytes ); while( count !=3D -1 && count <=3D 8192 ) { datastr =3D getString(bytes, count); sb.append(datastr); count =3D bis.read( bytes ); } bis.close(); reply =3D sb.toString(); This is the correct way to read response when expecting large response data= . Regards, On 3/21/06, Chaitanya Ravi wrote: > > Hi Ricky, > > You can kill them by including these 3 lines in your class constructor > > System.setProperty("org.apache.commons.logging.Log", " > org.apache.commons.logging.impl.SimpleLog"); > System.setProperty ("org.apache.commons.logging.simplelog.showdatetime", > "true"); > System.setProperty(" > org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", > "error"); > > > > Regards > Chaitanya > > > > On 3/21/06, Ricky wrote: > > > > Hi, > > How do I remove warning message from console? > > > > Mar 21, 2006 1:41:11 PM org.apache.commons.httpclient.HttpMethodBase > > getResponseBody > > WARNING: Going to buffer response body of large or unknown size. Using > > getResponseBodyAsStream instead is recommended. > > > > Thanks, > > > > Ricky > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: httpclient-user-help@jakarta.apache.or= g > > > > > -- Chaitanya Ravi, e-Trust, CA,ITC E-Mail: chaitanya.ravi@ca.com ------=_Part_2590_19614593.1142934820875--