Example #1
0
        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            base.ApplyConfiguration(bindingElement);
            HttpTransportBindingElement binding = (HttpTransportBindingElement)bindingElement;

            binding.AllowCookies           = this.AllowCookies;
            binding.AuthenticationScheme   = this.AuthenticationScheme;
            binding.BypassProxyOnLocal     = this.BypassProxyOnLocal;
            binding.DecompressionEnabled   = this.DecompressionEnabled;
            binding.KeepAliveEnabled       = this.KeepAliveEnabled;
            binding.HostNameComparisonMode = this.HostNameComparisonMode;
            PropertyInformationCollection propertyInfo = this.ElementInformation.Properties;

            if (propertyInfo[ConfigurationStrings.MaxBufferSize].ValueOrigin != PropertyValueOrigin.Default)
            {
                binding.MaxBufferSize = this.MaxBufferSize;
            }
            binding.MaxPendingAccepts         = this.MaxPendingAccepts;
            binding.ProxyAddress              = this.ProxyAddress;
            binding.ProxyAuthenticationScheme = this.ProxyAuthenticationScheme;
            binding.Realm = this.Realm;
            binding.RequestInitializationTimeout = this.RequestInitializationTimeout;
            binding.TransferMode = this.TransferMode;
            binding.UnsafeConnectionNtlmAuthentication = this.UnsafeConnectionNtlmAuthentication;
            binding.UseDefaultWebProxy       = this.UseDefaultWebProxy;
            binding.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy);
            this.WebSocketSettings.ApplyConfiguration(binding.WebSocketSettings);
            if (this.MessageHandlerFactory != null)
            {
                binding.MessageHandlerFactory = HttpMessageHandlerFactory.CreateFromConfigurationElement(this.MessageHandlerFactory);
            }
        }