示例#1
0
        public BasicHttpBinding(string configurationName) : this()
        {
            BindingsSection         bindingsSection = Configuration.ConfigUtil.BindingsSection;
            BasicHttpBindingElement el = bindingsSection.BasicHttpBinding.Bindings[configurationName];

            el.ApplyConfiguration(this);
        }
示例#2
0
        private void ApplyConfiguration(string configurationName)
        {
            BasicHttpBindingElement element2 = BasicHttpBindingCollectionElement.GetBindingCollectionElement().Bindings[configurationName];

            if (element2 == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(System.ServiceModel.SR.GetString("ConfigInvalidBindingConfigurationName", new object[] { configurationName, "basicHttpBinding" })));
            }
            element2.ApplyConfiguration(this);
        }
示例#3
0
        private BasicHttpBinding CreateBindingFromConfig()
        {
            ServiceModelSectionGroup config  = (ServiceModelSectionGroup)ConfigurationManager.OpenExeConfiguration("Test/config/basicHttpBinding").GetSectionGroup("system.serviceModel");
            BindingsSection          section = (BindingsSection)config.Bindings;
            BasicHttpBindingElement  el      = section.BasicHttpBinding.Bindings ["BasicHttpBinding2_Service"];

            BasicHttpBinding b = new BasicHttpBinding();

            el.ApplyConfiguration(b);

            return(b);
        }
示例#4
0
        void ApplyConfiguration(string configurationName)
        {
            BasicHttpBindingCollectionElement section = BasicHttpBindingCollectionElement.GetBindingCollectionElement();
            BasicHttpBindingElement           element = section.Bindings[configurationName];

            if (element == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(
                                                                              SR.GetString(SR.ConfigInvalidBindingConfigurationName,
                                                                                           configurationName,
                                                                                           ConfigurationStrings.BasicHttpBindingCollectionElementName)));
            }
            else
            {
                element.ApplyConfiguration(this);
            }
        }