473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 6399

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Farmer | last post by:
I am having problems accessing a managed object from unmanaged code. Specifically, I have a .NET forms application with a web service proxy. The forms application links to an unmanaged DLL which...
1
by: Eirik Brattbakk | last post by:
Hi I have some problems accessing a soap service made in c# using an ATL/MFC client over SSL. I have tried both CSoapMSXMLInetClient and CSoapWininetClient as template arguments with my stub...
0
by: George | last post by:
Hello, I'm running an ASPX application "WebApplication1" which consumes a web service (service1.asmx) hosted on a machine with IP (128.1.7.x) . The web service is located in the intranet. The...
0
by: John Bown | last post by:
This query is similar to some others on this discussion group, but none of them were resolved! Can anybody help: The issue is related to integrated authentication. First I'll describe a simple...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
1
by: Nestor | last post by:
Hello all, I'm begining in the web services world and I've reading about how to invoke them using javascript from Mozilla browser (version 2.0 in my case). I found a very interesting example...
1
by: =?Utf-8?B?Tmljaw==?= | last post by:
Hello, I hope I'm hoping posting this in the correct place. I've got an asmx web service and another guy created a client app that we distribute to customers. We seem to be having some trouble...
10
by: Ben | last post by:
I'm trying to access a c# web service from a web form. I set up the web reference proxy object as follows: proxy.PreAuthenticate = true; proxy.Credentials = CredentialCache.DefaultCredentials;...
4
by: Jon | last post by:
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...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.