Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accessing a web service - proxy problem

3 views
Skip to first unread message

Jon

unread,
May 7, 2008, 6:26:02 AM5/7/08
to
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?


Arnold@arnold.com Mr. Arnold

unread,
May 7, 2008, 7:43:07 AM5/7/08
to

"Jon" <.> wrote in message news:%23NKO8yC...@TK2MSFTNGP03.phx.gbl...

MS.Public.dotnet.framework.webservices.


Jon

unread,
May 7, 2008, 12:12:18 PM5/7/08
to
Thanks for you suggestion - I've re-posted my question there.

Jon


"Mr. Arnold" <MR. Arn...@Arnold.com> wrote in message news:eYWTKeD...@TK2MSFTNGP06.phx.gbl...

Tim Jarvis

unread,
May 7, 2008, 9:35:58 PM5/7/08
to
Jon wrote:

> 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.

--

Tim Jarvis

unread,
May 7, 2008, 9:41:47 PM5/7/08
to
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.

--

Jon

unread,
May 9, 2008, 4:49:57 AM5/9/08
to
Thanks Tim.

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

Jon


"Tim Jarvis" <t...@jarvis.com.au> wrote in message news:e0qnuyK...@TK2MSFTNGP02.phx.gbl...

Tim Jarvis

unread,
May 9, 2008, 5:27:06 PM5/9/08
to
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.


--

0 new messages