internal void InitializeFrom(WSDualHttpSecurity security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     this.Mode = security.Mode;
     this.Message.InitializeFrom(security.Message);
 }
 internal void ApplyConfiguration(WSDualHttpSecurity security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     security.Mode = this.Mode;
     this.Message.ApplyConfiguration(security.Message);
 }
 internal void InitializeFrom(WSDualHttpSecurity security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Mode, security.Mode);
     this.Message.InitializeFrom(security.Message);
 }
 WSDualHttpBinding(
     HttpTransportBindingElement transport,
     MessageEncodingBindingElement encoding,
     TransactionFlowBindingElement txFlow,
     ReliableSessionBindingElement session,
     CompositeDuplexBindingElement compositeDuplex,
     OneWayBindingElement oneWay,
     WSDualHttpSecurity security)
     : this()
 {
     this.security = security;
     InitializeFrom(transport, encoding, txFlow, session, compositeDuplex, oneWay);
 }
 WSDualHttpBinding(
     HttpTransportBindingElement transport,
     MessageEncodingBindingElement encoding,
     TransactionFlowBindingElement txFlow,
     ReliableSessionBindingElement session,
     CompositeDuplexBindingElement compositeDuplex,
     OneWayBindingElement oneWay,
     WSDualHttpSecurity security)
     : this()
 {
     this.security = security;
     InitializeFrom(transport, encoding, txFlow, session, compositeDuplex, oneWay);
 }
 internal static bool TryCreate(SecurityBindingElement sbe, out WSDualHttpSecurity security)
 {
     security = null;
     if (sbe == null)
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.None, null);
     else
     {
         MessageSecurityOverHttp messageSecurity;
         if (!MessageSecurityOverHttp.TryCreate(sbe, false, true, out messageSecurity))
             return false;
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.Message, messageSecurity);
     }
     // the last check: make sure that security binding element match the incoming security
     return SecurityElement.AreBindingsMatching(security.CreateMessageSecurity(), sbe);
 }
Example #7
0
 internal static bool TryCreate(SecurityBindingElement sbe, out WSDualHttpSecurity security)
 {
     security = null;
     if (sbe == null)
     {
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.None, null);
     }
     else
     {
         MessageSecurityOverHttp http;
         if (!MessageSecurityOverHttp.TryCreate <MessageSecurityOverHttp>(sbe, false, true, out http))
         {
             return(false);
         }
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.Message, http);
     }
     return(SecurityElementBase.AreBindingsMatching(security.CreateMessageSecurity(), sbe));
 }
 internal static bool TryCreate(SecurityBindingElement sbe, out WSDualHttpSecurity security)
 {
     security = null;
     if (sbe == null)
     {
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.None, null);
     }
     else
     {
         MessageSecurityOverHttp http;
         if (!MessageSecurityOverHttp.TryCreate<MessageSecurityOverHttp>(sbe, false, true, out http))
         {
             return false;
         }
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.Message, http);
     }
     return SecurityElementBase.AreBindingsMatching(security.CreateMessageSecurity(), sbe);
 }
Example #9
0
 internal static bool TryCreate(SecurityBindingElement sbe, out WSDualHttpSecurity security)
 {
     security = null;
     if (sbe == null)
     {
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.None, null);
     }
     else
     {
         MessageSecurityOverHttp messageSecurity;
         if (!MessageSecurityOverHttp.TryCreate(sbe, false, true, out messageSecurity))
         {
             return(false);
         }
         security = new WSDualHttpSecurity(WSDualHttpSecurityMode.Message, messageSecurity);
     }
     // the last check: make sure that security binding element match the incoming security
     return(SecurityElement.AreBindingsMatching(security.CreateMessageSecurity(), sbe));
 }
Example #10
0
        private static void GetWSDualHttpBindingDetails(WSDualHttpBinding binding, ref string name, ref string mode, ref string credentialType)
        {
            name = GetBindingName <WSDualHttpBinding>(binding);

            WSDualHttpSecurity wSDualHttpSecurity = binding.Security;

            mode = wSDualHttpSecurity?.Mode.ToString();
            switch (wSDualHttpSecurity?.Mode)
            {
            case WSDualHttpSecurityMode.None:
                credentialType = "N/A";
                break;

            case WSDualHttpSecurityMode.Message:
                credentialType = wSDualHttpSecurity.Message?.ClientCredentialType.ToString();
                break;
                // No Transport mode
            }
        }
 public WSDualHttpBinding()
 {
     this.security = new WSDualHttpSecurity();
     this.Initialize();
 }
Example #12
0
		protected WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
		{
			security = new WSDualHttpSecurity (securityMode);
		}
 public WSDualHttpBinding(WSDualHttpSecurityMode securityMode)
 {
     security = new WSDualHttpSecurity(securityMode);
 }
 static bool TryCreateSecurity(SecurityBindingElement securityElement, out WSDualHttpSecurity security)
 {
     return(WSDualHttpSecurity.TryCreate(securityElement, out security));
 }
Example #15
0
		public WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
		{
			security = new WSDualHttpSecurity (securityMode);
		}
 private static bool TryCreateSecurity(SecurityBindingElement securityElement, out WSDualHttpSecurity security)
 {
     return WSDualHttpSecurity.TryCreate(securityElement, out security);
 }
 public WSDualHttpBinding()
 {
     this.security = new WSDualHttpSecurity();
     this.Initialize();
 }
Example #18
0
 protected WSDualHttpBinding(WSDualHttpSecurityMode securityMode)
 {
     security = new WSDualHttpSecurity(securityMode);
 }