468,251 Members | 1,479 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,251 developers. It's quick & easy.

Accessing a web service - proxy problem

Jon
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a
direct connection to the internet, but on two different PCs with internet access via a proxy, I get
this exception:

System.Net.WebException: The request failed with HTTP status 407: Proxy Authentication Required.
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[]
parameters)

The internet works fine on this PC with IE and Firefox. In these two browsers, a proxy is set up.
Use a proxy server for your LAN is ticked, and the address and port (80) has been entered.

Am I right in saying that my programme is not able to access the settings of the web browsers, so I
need to configure my programme with the proxy details. If so, how do I supply this information to
the proxy. Or is there a way to access the settings from IE/Firefox?
Jun 27 '08 #1
6 6249

"Jon" <.wrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
>I wrote a VS 2005 C# express programme that accesses a web service. It
works fine when there's a
direct connection to the internet, but on two different PCs with internet
access via a proxy, I get
this exception:

System.Net.WebException: The request failed with HTTP status 407: Proxy
Authentication Required.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[]
parameters)

The internet works fine on this PC with IE and Firefox. In these two
browsers, a proxy is set up.
Use a proxy server for your LAN is ticked, and the address and port (80)
has been entered.

Am I right in saying that my programme is not able to access the settings
of the web browsers, so I
need to configure my programme with the proxy details. If so, how do I
supply this information to
the proxy. Or is there a way to access the settings from IE/Firefox?

MS.Public.dotnet.framework.webservices.
Jun 27 '08 #2
Jon
Thanks for you suggestion - I've re-posted my question there.

Jon
"Mr. Arnold" <MR. Ar****@Arnold.comwrote in message news:eY*************@TK2MSFTNGP06.phx.gbl...

"Jon" <.wrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
>I wrote a VS 2005 C# express programme that accesses a web service. It
works fine when there's a
direct connection to the internet, but on two different PCs with internet
access via a proxy, I get
this exception:

System.Net.WebException: The request failed with HTTP status 407: Proxy
Authentication Required.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[]
parameters)

The internet works fine on this PC with IE and Firefox. In these two
browsers, a proxy is set up.
Use a proxy server for your LAN is ticked, and the address and port (80)
has been entered.

Am I right in saying that my programme is not able to access the settings
of the web browsers, so I
need to configure my programme with the proxy details. If so, how do I
supply this information to
the proxy. Or is there a way to access the settings from IE/Firefox?

MS.Public.dotnet.framework.webservices.

Jun 27 '08 #3
Jon wrote:
System.Net.WebException: The request failed with HTTP status 407:
Proxy Authentication Required. at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(Soap
ClientMessage message, WebResponse response, Stream responseStream,
Boolean asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
hah, interesting timing, I had a very similar issue just the other day,
my workaround was to do this...

WebProxy proxy = new WebProxy(@"http://proxy.prod.quest.corp:8080");
proxy.Credentials = new NetworkCredential(usr, pswd, "prod");
WebRequest.DefaultWebProxy = proxy;

Cheers Tim.

--

Jun 27 '08 #4
Tim Jarvis wrote:
WebProxy proxy = new WebProxy(<proxyURI>);
proxy.Credentials = new NetworkCredential(usr, pswd, <domain>);
WebRequest.DefaultWebProxy = proxy;
Oops, I shouldn't really have shown the proxy server address here :-)
oh well.

Also, I call this a workaround, because I think that the more correct
thing to do is for the Soap client to provide a .proxy property so that
it can include the authentication in the soap header (I think this is
correct) as this approach, is a sledgehammer approach...but it does
work, and thats the main thing.

Cheers Tim.

--

Jun 27 '08 #5
Jon
Thanks Tim.

You may also be interested in the reply that I had when I reposted on dotnet.framework.webservices.

Jon
"Tim Jarvis" <ti*@jarvis.com.auwrote in message news:e0*************@TK2MSFTNGP02.phx.gbl...
Tim Jarvis wrote:
WebProxy proxy = new WebProxy(<proxyURI>);
proxy.Credentials = new NetworkCredential(usr, pswd, <domain>);
WebRequest.DefaultWebProxy = proxy;
Oops, I shouldn't really have shown the proxy server address here :-)
oh well.

Also, I call this a workaround, because I think that the more correct
thing to do is for the Soap client to provide a .proxy property so that
it can include the authentication in the soap header (I think this is
correct) as this approach, is a sledgehammer approach...but it does
work, and thats the main thing.

Cheers Tim.

--
Jun 27 '08 #6
Jon wrote:
Thanks Tim.

You may also be interested in the reply that I had when I reposted on
dotnet.framework.webservices.
Cool, thanks for that. That link that Steven sent you is useful.

Cheers Tim.
--

Jun 27 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bruce Farmer | last post: by
1 post views Thread by Nestor | last post: by
1 post views Thread by =?Utf-8?B?Tmljaw==?= | last post: by
10 posts views Thread by Ben | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.