473,841 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.WebE xception: The request failed with HTTP status 407: Proxy Authentication Required.
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.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
4 4472
Hi Jon,

As for the network wroxy setting, for .NET webservice proxy class(or other
webrequest components), you can explicitly assign a webproxy(and
credentials if authentication required) to it. e.g.

=====
Webservice client = new Webservice();
client.Proxy = new WebProxy(server name, port);
=======

the following article provide a detailed example:

#Consuming a Webservice from behind a Proxy Firewall
http://www.c-sharpcorner.com/UploadF...hindproxy11212
006054829AM/webservicebehin dproxy.aspx

Also, you can take full advantage of system or webbrowser proxy settings
from .NET framework 2.0. However, the detailed behavior depand on the
account under which your application is running and also the proxy setting
model(global or per user) is used on the machine. Here is a good MSDN
article mentioned details about proxy detection in .NET framework (from 11.
to 2.0)

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Jon" <.>
Subject: Accessing a web service - proxy problem
Date: Wed, 7 May 2008 17:11:35 +0100
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.WebE xception: The request failed with HTTP status 407: Proxy
Authentication Required.
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien t
Message message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.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 #2
Jon
Hi Steven,

Thanks very much for your help with this.

You mentioned this article "Here is a good MSDN article mentioned details about proxy detection in
..NET framework (from 11. to 2.0)" but didn't provide a link to it. Could you provide the link
please?

Thanks,

Jon
"Steven Cheng [MSFT]" <st*****@online .microsoft.comw rote in message
news:vs******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Jon,

As for the network wroxy setting, for .NET webservice proxy class(or other
webrequest components), you can explicitly assign a webproxy(and
credentials if authentication required) to it. e.g.

=====
Webservice client = new Webservice();
client.Proxy = new WebProxy(server name, port);
=======

the following article provide a detailed example:

#Consuming a Webservice from behind a Proxy Firewall
http://www.c-sharpcorner.com/UploadF...hindproxy11212
006054829AM/webservicebehin dproxy.aspx

Also, you can take full advantage of system or webbrowser proxy settings
from .NET framework 2.0. However, the detailed behavior depand on the
account under which your application is running and also the proxy setting
model(global or per user) is used on the machine. Here is a good MSDN
article mentioned details about proxy detection in .NET framework (from 11.
to 2.0)

Hope this helps.

Sincerely,

Steven Cheng
From: "Jon" <.>
Subject: Accessing a web service - proxy problem
Date: Wed, 7 May 2008 17:11:35 +0100
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.WebE xception: The request failed with HTTP status 407: Proxy
Authentication Required.
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien t
Message message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.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 #3
Hi Jon,

Thanks for your reply.

Oops... I'm sorry for the omit. Trust me that I'm was not making joke :-).

here is the msdn reference, should be the best one which describe about the
proxy settings I've seen so far:

#Take the Burden Off Users with Automatic Configuration in .NET
http://msdn.microsoft.com/en-us/magazine/cc300743.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Jon" <.>
References: <ui************ **@TK2MSFTNGP03 .phx.gbl>
<vs************ **@TK2MSFTNGHUB 02.phx.gbl>
Subject: Re: Accessing a web service - proxy problem
Date: Fri, 9 May 2008 09:43:08 +0100
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
Message-ID: <en************ **@TK2MSFTNGP05 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: 212.2.3.58
Path: TK2MSFTNGHUB02. phx.gbl!TK2MSFT NGP01.phx.gbl!T K2MSFTNGP05.phx .gbl
microsoft.publi c.dotnet.framew ork.webservices :3525
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Hi Steven,

Thanks very much for your help with this.

You mentioned this article "Here is a good MSDN article mentioned details
about proxy detection in
.NET framework (from 11. to 2.0)" but didn't provide a link to it. Could
you provide the link
please?

Thanks,

Jon
"Steven Cheng [MSFT]" <st*****@online .microsoft.comw rote in message
news:vs******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Jon,

As for the network wroxy setting, for .NET webservice proxy class(or other
webrequest components), you can explicitly assign a webproxy(and
credentials if authentication required) to it. e.g.

=====
Webservice client = new Webservice();
client.Proxy = new WebProxy(server name, port);
=======

the following article provide a detailed example:

#Consuming a Webservice from behind a Proxy Firewall
http://www.c-sharpcorner.com/UploadF...hindproxy11212
006054829AM/webservicebehin dproxy.aspx

Also, you can take full advantage of system or webbrowser proxy settings
from .NET framework 2.0. However, the detailed behavior depand on the
account under which your application is running and also the proxy setting
model(global or per user) is used on the machine. Here is a good MSDN
article mentioned details about proxy detection in .NET framework (from 11.
to 2.0)

Hope this helps.

Sincerely,

Steven Cheng
From: "Jon" <.>
Subject: Accessing a web service - proxy problem
Date: Wed, 7 May 2008 17:11:35 +0100
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.WebE xception: The request failed with HTTP status 407: Proxy
Authentication Required.
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien t
Message message,
WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.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 #4
Hi Jon,

Have you resolved the issue? Or does the article I posted in last message
help you some?

If you have any further questions, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

--------------------
From: st*****@online. microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Fri, 09 May 2008 10:08:31 GMT
Subject: Re: Accessing a web service - proxy problem

Hi Jon,

Thanks for your reply.

Oops... I'm sorry for the omit. Trust me that I'm was not making joke :-).

here is the msdn reference, should be the best one which describe about the
proxy settings I've seen so far:

#Take the Burden Off Users with Automatic Configuration in .NET
http://msdn.microsoft.com/en-us/magazine/cc300743.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2345
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 uses callbacks to receive data via TCP. The data received in the callback must be passed to a web service via a web method provided by the proxy. So the callback (which is unmanaged code) needs to access the proxy (managed object) to send the...
1
3963
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 class. The service is returning with the error code: -2147467259. I have not succeeded to find any additional information about the error. The "SoapFault" method seems to return only a bunch of question marks.
0
2645
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 web methods can be invoked successfully if "WebApplication1" is located in machines with the same subnet (128.1.7.x). However, it fails if "WebApplication1" is hosted on
0
3599
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 scenario not involving ISA server, which works as expected: The web service is hosted on a server in the same domain as my workstation with anonymous access denied, and integrated authentication enabled. If I access the web service using the...
7
7119
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 work with J2ME client a) c# web service works with c# WIndows Client (local & remote web service) b) c# web service works with J2ME client - when the Web Service is local c) c# web service fails with J2ME client - when the Web Service is remote ...
1
2012
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 here: http://www.mozilla.org/projects/webservices/examples/babelfish-wsdl/index.html The problem I have is this: When I try to adapt the invokation on the
1
1207
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 with customers accessing the service who are behind firewalls or are using proxy servers. Is there a way to detect their settings so we can avoid this problem? I don't have a great deal of experience accessing web services, so any help is...
10
1971
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; but i get a 401 error. If I switch the IIS website from Integrated Windows Auth to Anonymous, it works... but i want it to use windows
10
9788
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 returned. So the username and password should be ok. I'm using this code: Merchant myMerch = new Merchant(); myMerch.merchantIdentifier=merchantId;
0
9706
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10927
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10667
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10303
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7848
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7025
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5691
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5880
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.