Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to set proxy in BasicHttpBinding

$
0
0

Hi,

I have problem with setting proxy in ApiControler what comunicates with other WCF service.

WCF client still ignore proxy setting.

My code is:

A.
BasicHttpBinding binding = new BasicHttpBinding();
binding.UseDefaultWebProxy = defaultProxyConfig.enabled;
binding.ProxyAddress = new System.Uri(defaultProxyConfig.proxy.proxyaddress);
binding.BypassProxyOnLocal = defaultProxyConfig.proxy.bypassonlocal;

B.
WebProxy proxy = new WebProxy(defaultProxyConfig.proxy.proxyaddress, defaultProxyConfig.proxy.bypassonlocal);
WebRequest.DefaultWebProxy = proxy;

When I try to call WCF service by WebRequest with proxy setting requestHttp.Proxy = new WebProxy("xxx.xxx.xxx.xxx:3128", true);

Proxy is set for using with this calling.

How can I set proxy for WCF client?
Can you help me please?


Viewing all articles
Browse latest Browse all 9386

Trending Articles