Example #1
0
        public static BasicHttpBinding GetWsdlBinding(model.IProxy proxy)
        {
            BasicHttpBinding binding = new BasicHttpBinding();

            if (proxy.ProxyType == model.Proxy.EProxyType.System)
            {
                binding.UseDefaultWebProxy = true;
            }
            else
            {
                WebProxy webProxy = ProxyWrapper.GetWebProxy(proxy);

                binding.UseDefaultWebProxy = false;
                if (proxy.ProxyType == model.Proxy.EProxyType.Enabled)
                {
                    binding.ProxyAddress = webProxy.Address;
                }
            }

            return(binding);
        }
Example #2
0
        public static WSHttpBinding GetMexBinding(model.IProxy proxy)
        {
            WSHttpBinding binding = new WSHttpBinding();

            binding.Security.Mode = SecurityMode.None;

            if (proxy.ProxyType == model.Proxy.EProxyType.System)
            {
                binding.UseDefaultWebProxy = true;
            }
            else
            {
                WebProxy webProxy = ProxyWrapper.GetWebProxy(proxy);

                binding.UseDefaultWebProxy = false;
                if (proxy.ProxyType == model.Proxy.EProxyType.Enabled)
                {
                    binding.ProxyAddress = webProxy.Address;
                }
            }

            return(binding);
        }