Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 87483 invoked from network); 31 Aug 2004 11:36:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 31 Aug 2004 11:36:24 -0000 Received: (qmail 77003 invoked by uid 500); 31 Aug 2004 11:36:14 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 76965 invoked by uid 500); 31 Aug 2004 11:36:14 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 76952 invoked by uid 99); 31 Aug 2004 11:36:13 -0000 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,URIBL_SBL X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of kutzi@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 31 Aug 2004 04:36:13 -0700 Received: (qmail 20479 invoked by uid 65534); 31 Aug 2004 11:36:10 -0000 Received: from unknown (EHLO [192.168.1.101]) (62.153.223.140) by mail.gmx.net (mp008) with SMTP; 31 Aug 2004 13:36:10 +0200 X-Authenticated: #383581 Message-ID: <413462A5.9070901@gmx.de> Date: Tue, 31 Aug 2004 13:36:05 +0200 From: Christoph Kutzinski User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: de, en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: httpclient: Behined ISA proxy server and need to reach Internet site References: <07712D6C0256E84FB2CF4DECD780D30770F69B@raya-sw1.rayasoftware.com> In-Reply-To: <07712D6C0256E84FB2CF4DECD780D30770F69B@raya-sw1.rayasoftware.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N http://jakarta.apache.org/commons/httpclient/authentication.html Search for NTLM. Looks like you need a NTCredential object. Ashraf Fouad wrote: > It gave me another error: > > [WARN] HttpMethodBase - -Credentials cannot be used for NTLM > authentication: > org.apache.commons.httpclient.UsernamePasswordCredentials > > HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires > authorization to fulfill the request. Access to the Web Proxy service is > denied. ) > > > Thanks, Best regards > > Ashraf Fouad Ayoub > Senior software developer > Raya Software > 1 Abdel Hameed Lotfy St., > Nasr City, Cairo 11371, Egypt > Phone: * (202) 670-3301/2/3/4/6/8 Ext. 295 > Fax:** (202) 670-3296 > Email: * ashraf_fouad@rayasoftware.com > Web: * > > -----Original Message----- > From: Michael Becke [mailto:becke@u.washington.edu] > Sent: Tuesday, August 31, 2004 12:57 PM > To: Jakarta Commons Users List > Subject: Re: httpclient: Behined ISA proxy server and need to reach > Internet site > > Hi Ashraf, > > I would suggest the following: > > client.getState().setProxyCredentials(null, ''192.168.0.200", > proxyCredentials); > > Mike > > On Aug 31, 2004, at 5:03 AM, Ashraf Fouad wrote: > > >>Dears, >> >>My client machine accesses the Internet through a proxy, I'm writing >>http client program to download page source from the Internet, here is >>my code: >> >> >> >> HttpClient client = new HttpClient(); >> >> HostConfiguration hostConfiguration = >>client.getHostConfiguration(); >> >> hostConfiguration.setProxy( "192.168.0.200", "8080" ); >> >> >> >> HttpState state = client.getState(); >> >> Credentials proxyCredentials = new UsernamePasswordCredentials( >>"username", "password" ); >> >> >> >> state.setCredentials( "rayasoftware.com", "192.168.0.200", >>proxyCredentials ); >> >> >> >> PostMethod cnnPost = new PostMethod( "http://www.cnn.com" ); >> >> cnnPost.setDoAuthentication( true ); >> >> >> >> client.executeMethod( cnnPost ); >> >> System.out.println( cnnPost.getStatusLine().toString() ); >> >> // release any connection resources used by the method >> >> cnnPost.releaseConnection(); >> >> >> >> >> >> >> >>I'm getting the following message: >> >> >> >> >>HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires >>authorization to fulfill the request. Access to the Web Proxy service >>is >>denied. ) >> >>[WARN] HttpMethodBase - -No credentials available for the 'null' >>authentication realm at 192.168.0.200 >> >>What is wrong with my code. >> >> >> >>Thanks, Best regards >> >>Ashraf Fouad Ayoub >>S/W Team leader >>Raya Software >> >> >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org