WSE 2..Net 1.1 A client calling from a local network for Internet service. How do I set up a proxy server?

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

When I make a call to WSE2 with a generated proxy, it fails with the following Microsoft.Web.Services2.AsynchronousOperationException.

WSE101: An asynchronous operation threw an exception.

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

The connected connection was closed: unable to connect to the remote server.

My first thought was that the proxy was not set in the client's proxy. This is the problem I ran into with asmx web services.

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

Does anyone have thoguhts?

thank

+1


source to share


1 answer


The client proxy usually inherits from HttpWebClientProtocol. This class has a Proxy property since .Net 1.0. Thus, you just need to create an appropriate proxy:



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

      

0


source







All Articles