hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: 400 Bad request is returned (Target Authentication)
Date Wed, 09 Mar 2011 19:52:08 GMT
On Wed, 2011-03-09 at 17:09 +0530, manasa k wrote:
> Hi all,
> 
> I am trying to connect a URL *
> http://renderv3.mappoint.net/render-30/RenderService.asmx *which needs
> WWW-Authenticate(uses Digest Authentication). Also this should go via a
> Proxy(uses Basic Authentication). Following is my code snippet,
> 
> *DefaultHttpClient httpclient = new DefaultHttpClient();*
> * HttpGet httpget = new HttpGet("
> http://renderv3.mappoint.net/render-30/RenderService.asmx");*
> * CredentialsProvider credsProvider = new BasicCredentialsProvider();*
> * credsProvider.setCredentials(new AuthScope("<Proxy Host>", <Proxy
> Port>),new UsernamePasswordCredentials("<Proxy UserName>", "<Proxy
> Password>"));*
> * credsProvider.setCredentials(new AuthScope("renderv3.mappoint.net", 80),
> new UsernamePasswordCredentials("<Target UserName>", "<Target Password>"));*
> * httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, new
> HttpHost("<Proxy Host>", <Proxy Port>));*
> * httpclient.setCredentialsProvider(credsProvider);*
> * HttpResponse response = httpclient.execute(httpget);//, localContext);*
> *
> *
> This returns *HTTP/1.0 400 Bad Request [Server: Microsoft-IIS/6.0, Date:
> Tue, 08 Mar 2011 13:38:43 GMT, X-Cache: MISS from proxy-server8-int1,
> Connection: close]....*
> *
> *
> When the request to this URL is sent directly(i.e., not going via Proxy),
> works perfectly.
> 
> Someone please help to check where I am going wrong.
> 
> Regards,
> Manasa

Please produce wire / context logs of both HTTP sessions.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message