Accessing a web service - proxy problem

J

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.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.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?
 
M

Mr. Arnold

Jon said:
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.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.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.
 
J

Jon

Thanks for you suggestion - I've re-posted my question there.

Jon



Jon said:
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.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.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.
 
T

Tim Jarvis

Jon said:
System.Net.WebException: The request failed with HTTP status 407:
Proxy Authentication Required. at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(Soap
ClientMessage message, WebResponse response, Stream responseStream,
Boolean asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.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.

--
 
T

Tim Jarvis

Tim said:
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.

--
 
J

Jon

Thanks Tim.

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

Jon


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.

--
 
T

Tim Jarvis

Jon said:
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.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top