public BasicHttpBinding(string configurationName) : this() { BindingsSection bindingsSection = Configuration.ConfigUtil.BindingsSection; BasicHttpBindingElement el = bindingsSection.BasicHttpBinding.Bindings[configurationName]; el.ApplyConfiguration(this); }
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); }
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); }
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); } }