By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,248 Members | 882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,248 IT Pros & Developers. It's quick & easy.

web service access - proxy server issue

P: n/a
Hi all,

I have an asp.net 2.0 website that accesses a locally hosted web service.
This works fine on servers that are connected to our network. However, I am
having a problem with a laptop server that I have built. The code that tries
to connect to the web service breaks if the laptop is not within our
network. Further debugging has revealed that this is due to a proxy server
issue. Our domain sets the proxy server via GPO for all machines on our
network. I have however disabled the proxy server in IE settings and have
confirmed that works. However for some reason .net does not seem to be
picking up this change and it still appears to be looking for our proxy
server even when it is not in our network i.e. remote offsite etc. I even
searched the registry for all instances of string occurence of our proxy
server and deleted them.

Any ideas?
Sep 23 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Param,

From your description, you're encountering some problem with proxy setting
of an ASP.NET web application which access a remote webservice, correct?

As you mentioned that sometimes the webserver machine is not placed in the
domain network environment(where the proxy server is accessible),
therefore, it is reasonable that when the server is not in domain network,
the webrequest call(via webservice) which utilize the system proxy
setting(default use IE setting) will fail.

I suggest you try the following approach:

1. In web.config file, you can turn off default proxy and manually specify
a proxy(in the <system.netconfigure section):

=============
<system.net>
<defaultProxy >
<proxy usesystemdefault="false" proxyaddress="" ></proxy>
</defaultProxy>
</system.net>
==============

2. Or you can manually set a proxy for the webservice's proxy in code. e.g.

==========
basicSVC.Service1 client = new basicSVC.Service1();

client.Proxy = new WebProxy("http://myproxy");
..............
===========

For how the .NET framework detect proxy, here is a good article for your
reference:

#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****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

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://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: <pa****@community.nospam>
Subject: web service access - proxy server issue
Date: Tue, 23 Sep 2008 18:09:43 -0500

Hi all,

I have an asp.net 2.0 website that accesses a locally hosted web service.
This works fine on servers that are connected to our network. However, I am
having a problem with a laptop server that I have built. The code that
tries
to connect to the web service breaks if the laptop is not within our
network. Further debugging has revealed that this is due to a proxy server
issue. Our domain sets the proxy server via GPO for all machines on our
network. I have however disabled the proxy server in IE settings and have
confirmed that works. However for some reason .net does not seem to be
picking up this change and it still appears to be looking for our proxy
server even when it is not in our network i.e. remote offsite etc. I even
searched the registry for all instances of string occurence of our proxy
server and deleted them.

Any ideas?

Sep 24 '08 #2

P: n/a
Hi Param,

How are you doing?

Does the information in my last reply help you some?

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****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

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

From: st*****@online.microsoft.com ("Steven Cheng")
Organization: Microsoft
Date: Wed, 24 Sep 2008 09:32:34 GMT
Subject: RE: web service access - proxy server issue

Hi Param,

From your description, you're encountering some problem with proxy setting
of an ASP.NET web application which access a remote webservice, correct?

As you mentioned that sometimes the webserver machine is not placed in the
domain network environment(where the proxy server is accessible),
therefore, it is reasonable that when the server is not in domain network,
the webrequest call(via webservice) which utilize the system proxy
setting(default use IE setting) will fail.

I suggest you try the following approach:

1. In web.config file, you can turn off default proxy and manually specify
a proxy(in the <system.netconfigure section):

=============
<system.net>
<defaultProxy >
<proxy usesystemdefault="false" proxyaddress="" ></proxy>
</defaultProxy>
</system.net>
==============

2. Or you can manually set a proxy for the webservice's proxy in code. e.g.

==========
basicSVC.Service1 client = new basicSVC.Service1();

client.Proxy = new WebProxy("http://myproxy");
..............
===========

For how the .NET framework detect proxy, here is a good article for your
reference:

#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:
Sep 26 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.