public AssertEncryptionHttpBinding(string configurationName) : this()
        {
            var bindingElement = AssertEncryptionHttpBindingCollectionElement.GetBindingCollectionElement().Bindings[configurationName] as AssertEncryptionHttpBindingElement;

            if (bindingElement == null)
            {
                throw new ConfigurationErrorsException(string.Format("Binding configuration element missing: {0} in {1}", configurationName, AssertEncryptionHttpBindingCollectionElement.BindingCollectionElementName));
            }

            bindingElement.ApplyConfiguration(this);
        }
Example #2
0
        public static AssertEncryptionHttpBindingCollectionElement GetBindingCollectionElement()
        {
            AssertEncryptionHttpBindingCollectionElement bindingCollectionElement = null;

            BindingsSection bindingsSection = ConfigurationManager.GetSection("system.serviceModel/bindings") as BindingsSection;

            if (bindingsSection != null)
            {
                bindingCollectionElement = bindingsSection[AssertEncryptionHttpBindingCollectionElement.BindingCollectionElementName] as AssertEncryptionHttpBindingCollectionElement;
            }

            return(bindingCollectionElement);
        }