472,978 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,978 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 6386

"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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.