WSE 2 .Net 1.1 Client calling from inside a LAN to service on the internet. How to set the proxy server?

942 Views Asked by At

Hi I am trying to connect to a WSE2 web service (.Net 1.1) on the internet The client (also .Net 1.1) is inside my company LAN and has to go out through a proxy server to the internet.

When I make the WSE2 call with the generated proxty it fails with the following Microsoft.Web.Services2.AsynchronousOperationException.

WSE101: An asynchronous operation raised an exception.

When I debug it there is an innerexception System.Net.WebException

The underlying connection was closed: Unable to connect to the remote server.

My first thought was that the Proxy server was not set in the client proxy, That being a problem I have had with asmx web services.

However when I look at the proxy code, which inherits from SoapClient there is no obvious way to set the proxy.

Does anybody have any thoguhts?

Thanks

1

There are 1 best solutions below

0
On

Client Proxy normally inherits from HttpWebClientProtocol. This class has Proxy property since .Net 1.0. So, you simply have to construct appropriate Proxy:

IWebProxy proxyObject = new WebProxy("http://proxyserver:80", true);
mySoapClientProxyObject.Proxy = proxyObject;