Web.Config

		<add key="RCT-Use-Proxy" value="true" />
		<add key="RCT-Proxy"     value="http://10.101.101.101:8080" />

C# Code:


            string strUseProxy = ConfigurationManager.AppSettings["RCT-Use-Proxy"];
            string strProxy = ConfigurationManager.AppSettings["RCT-Proxy"];
            bool useProxy = System.Convert.ToBoolean(strUseProxy);
            if (useProxy)
            {
                valservice.Proxy = new System.Net.WebProxy(strProxy, true);
            }

Tagged with:

Filed under: WCF