This step-by-step article describes how to allow an XML Web service client application that is built with the .NET runtime to connect to a service through a Hypertext Transfer Protocol (HTTP) proxy server.
Configure the HTTP Proxy Settings for Desktop and ASP.NET Applications
Generally, the .NET runtime uses the default proxy settings that have been set for Microsoft Internet Explorer when it is used from a standard desktop application. If you can browse to the Web site where your Web service is located, you can make calls with the .NET runtime without making a change because your settings are retrieved from where they are stored in your user profile.
The .NET runtime does not, however, support automatic proxy discovery scripts. If Internet Explorer uses the automatic configuration options to determine the HTTP proxy settings, you can manually configure the global HTTP proxy settings in the Machine.config file. Likewise, if you are using the .NET runtime to access an XML Web service in a situation in which a user profile is not loaded (for example, if you call an XML Web service from an ASP.NET page), you must configure the computer settings in the Machine.config file.
To configure the HTTP proxy settings for desktop and ASP.NET applications, follow these steps:
Edit the Machine.config file. For the .NET Framework, the default location for this file is C:\WINNT\Microsoft .NET\Framework\v1.0.2914\CONFIG\machine.config.
Locate the \configuration\system.net\defaultProxy element in the XML.
Change the child <proxy> element to the following, where http://myproxyserver indicates your HTTP proxy server:
This syntax avoids sending any requests to localdomain.com and localdomain2.com through the HTTP proxy. The address attribute is actually a string that contains a regular expression. For more information on the syntax of regular expressions, see the information on System.Text.RegularExpresions in the .NET runtime documentation.
Save the changes to Machine.config and restart the application.