Ejemplo n.º 1
0
        public BasicHttpsBinding(string configurationName)
            : this()
        {
            BindingsSection          bindingsSection = ConfigUtil.BindingsSection;
            BasicHttpsBindingElement el =
                bindingsSection.BasicHttpsBinding.Bindings [configurationName];

            el.ApplyConfiguration(this);
        }
Ejemplo n.º 2
0
        public WebHttpBinding(string configurationName)
        {
#if !NET_2_1 && !XAMMAC_4_5
            BindingsSection       bindingsSection = ConfigUtil.BindingsSection;
            WebHttpBindingElement el = (WebHttpBindingElement)bindingsSection ["webHttpBinding"].ConfiguredBindings.FirstOrDefault(c => c.Name == configurationName);
            if (el != null)
            {
                Initialize(el.Security.Mode);                  // to initialize Transport correctly.
                el.ApplyConfiguration(this);
            }
            else if (!String.IsNullOrEmpty(configurationName))
            {
                throw new ConfigurationException(String.Format("Specified webHttpBinding configuration '{0}' was not found", configurationName));
            }
            else
            {
                Initialize(WebHttpSecurityMode.None);
            }
#else
            Initialize(WebHttpSecurityMode.None);
#endif
        }