Proxy Servers can demand authentication just like web servers do.
When you are on an Intranet environment, IE takes care of sending
your current credentials so you don;t see this in action unless you use a
netmon.
1) If you want to specify credentials to a proxy server, do the following
If you want to use the same settings as IE does
WebProxy wp = GlobalProxySelection.Select as WebProxy;
wp.Credentials = CredentialCache.DefaultCredentials;
or
If you have your own custom proxy that is different from IE
WebProxy wp = new WebProxy(....)
wp.Credentials = CredentialCache.DefaultCredentials;
2) If you want to set credentials to a server
HttpWebRequest .hr = ...
hr.Credentials = CredentialCache.DefaultCredentials;
Durgaprasad Gorti
Microsoft
----------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
--------------
--------------------
|From: "Tomas Restrepo \(MVP\)" <
[email protected]>
|References: <e4#
[email protected]>
|Subject: Re: 407
roxy authentication error while try to access Web
Service published on internet
|Date: Sun, 4 Jul 2004 12:11:46 -0500
|Lines: 30
|X-Priority: 3
|X-MSMail-Priority: Normal
|X-Newsreader: Microsoft Outlook Express 6.00.3790.0
|X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.132
|Message-ID: <#41G#
[email protected]>
|Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
|NNTP-Posting-Host: 200.116.19.42
|Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
..phx.gbl
|Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:24416
|X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
|Does the proxy you're using require authentication?
|Remember that you deal with two possible sets of credentials here... those
|attached directly to the webservice client are used to access the
|webservice, while you can have a second set of credentials attached to the
|HTTP Proxy object that are used for authentication against the actual proxy
|server on your network...
|
|--
|Tomas Restrepo
|
[email protected]
|
||Hi,
|I wanted to consume a webservice
|(
http://www.webservicex.com/CurrencyConvertor.asmx) published on Internet
|and i am behind proxy server and I try to add in my application as it gives
|the 407
roxy authentication error. I passed network credential also. I
|created Proxy class and added in my project reference also. Is there
anybody
|to help?
|
|--------------------------------
|From: Nuzhat Parveen
|
|-----------------------
|Posted by a user from .NET 247 (
http://www.dotnet247.com/)
|
|<Id>GfW+kmP4JUy1ZjH7qgv6WA==</Id>
|
|
|