private void Initialize()
 {
     this.transport       = new TcpTransportBindingElement();
     this.encoding        = new BinaryMessageEncodingBindingElement();
     this.context         = GetDefaultTransactionFlowBindingElement();
     this.session         = new ReliableSessionBindingElement();
     this.reliableSession = new OptionalReliableSession(this.session);
 }
 public void InitializeFrom(OptionalReliableSession optionalReliableSession)
 {
     if (optionalReliableSession == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("optionalReliableSession");
     }
     base.InitializeFrom(optionalReliableSession);
     this.Enabled = optionalReliableSession.Enabled;
 }
Example #3
0
 private void Initialize()
 {
     HttpTransport  = new HttpTransportBindingElement();
     HttpsTransport = new HttpsTransportBindingElement();
     _session       = new ReliableSessionBindingElement(true);
     _textEncoding  = new TextMessageEncodingBindingElement();
     _textEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     _reliableSession             = new OptionalReliableSession(_session);
 }
 public void ApplyConfiguration(OptionalReliableSession optionalReliableSession)
 {
     if (null == optionalReliableSession)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("optionalReliableSession");
     }
     base.ApplyConfiguration(optionalReliableSession);
     optionalReliableSession.Enabled = this.Enabled;
 }
 public void InitializeFrom(OptionalReliableSession optionalReliableSession)
 {
     if (null == optionalReliableSession)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("optionalReliableSession");
     }
     base.InitializeFrom(optionalReliableSession);
     SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Enabled, optionalReliableSession.Enabled);
 }
Example #6
0
        private void Initialize()
        {
            _transport = new TcpTransportBindingElement();
            _encoding  = new BinaryMessageEncodingBindingElement();

            // NetNative and CoreCLR initialize to what TransportBindingElement does in the desktop
            // This property is not available in shipped contracts
            MaxBufferPoolSize    = TransportDefaults.MaxBufferPoolSize;
            session              = new ReliableSessionBindingElement();
            this.reliableSession = new OptionalReliableSession(session);
        }
Example #7
0
 void Initialize()
 {
     httpTransport               = new HttpTransportBindingElement();
     httpsTransport              = new HttpsTransportBindingElement();
     messageEncoding             = WSHttpBindingDefaults.MessageEncoding;
     txFlow                      = GetDefaultTransactionFlowBindingElement();
     session                     = new ReliableSessionBindingElement(true);
     textEncoding                = new TextMessageEncodingBindingElement();
     textEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     mtomEncoding                = new MtomMessageEncodingBindingElement();
     mtomEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     reliableSession             = new OptionalReliableSession(session);
 }
Example #8
0
 private void Initialize()
 {
     this.httpTransport               = new HttpTransportBindingElement();
     this.httpsTransport              = new HttpsTransportBindingElement();
     this.messageEncoding             = WSMessageEncoding.Text;
     this.txFlow                      = GetDefaultTransactionFlowBindingElement();
     this.session                     = new System.ServiceModel.Channels.ReliableSessionBindingElement(true);
     this.textEncoding                = new TextMessageEncodingBindingElement();
     this.textEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     this.mtomEncoding                = new MtomMessageEncodingBindingElement();
     this.mtomEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     this.reliableSession             = new OptionalReliableSession(this.session);
 }
 private void Initialize()
 {
     this.httpTransport = new HttpTransportBindingElement();
     this.httpsTransport = new HttpsTransportBindingElement();
     this.messageEncoding = WSMessageEncoding.Text;
     this.txFlow = GetDefaultTransactionFlowBindingElement();
     this.session = new System.ServiceModel.Channels.ReliableSessionBindingElement(true);
     this.textEncoding = new TextMessageEncodingBindingElement();
     this.textEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     this.mtomEncoding = new MtomMessageEncodingBindingElement();
     this.mtomEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     this.reliableSession = new OptionalReliableSession(this.session);
 }
Example #10
0
 private void Initialize()
 {
     _messageEncoding = NetHttpBindingDefaults.MessageEncoding;
     _binaryMessageEncodingBindingElement = new BinaryMessageEncodingBindingElement()
     {
         MessageVersion = MessageVersion.Soap12WSAddressing10
     };
     this.TextMessageEncodingBindingElement.MessageVersion = MessageVersion.Soap12WSAddressing10;
     _session         = new ReliableSessionBindingElement();
     _reliableSession = new OptionalReliableSession(_session);
     this.WebSocketSettings.TransportUsage = NetHttpBindingDefaults.TransportUsage;
     this.WebSocketSettings.SubProtocol    = WebSocketTransportSettings.SoapSubProtocol;
     _basicHttpSecurity = new BasicHttpSecurity();
 }
 void Initialize()
 {
     this.messageEncoding = NetHttpBindingDefaults.MessageEncoding;
     this.binaryMessageEncodingBindingElement = new BinaryMessageEncodingBindingElement()
     {
         MessageVersion = MessageVersion.Soap12WSAddressing10
     };
     this.TextMessageEncodingBindingElement.MessageVersion = MessageVersion.Soap12WSAddressing10;
     this.MtomMessageEncodingBindingElement.MessageVersion = MessageVersion.Soap12WSAddressing10;
     this.session         = new ReliableSessionBindingElement();
     this.reliableSession = new OptionalReliableSession(this.session);
     this.InternalWebSocketSettings.TransportUsage = NetHttpBindingDefaults.TransportUsage;
     this.InternalWebSocketSettings.SubProtocol    = WebSocketTransportSettings.SoapSubProtocol;
     this.basicHttpsSecurity = new BasicHttpsSecurity();
 }
Example #12
0
 internal void CopySettings(OptionalReliableSession copyFrom)
 {
     Enabled = copyFrom.Enabled;
 }
 internal void CopySettings(OptionalReliableSession copyFrom)
 {
     base.CopySettings(copyFrom);
     this.Enabled = copyFrom.Enabled;
 }
Example #14
0
 protected WSHttpBindingBase(bool reliableSessionEnabled)
 {
     reliable_session         = new OptionalReliableSession(rel_element);
     reliable_session.Enabled = reliableSessionEnabled;
 }
 void Initialize()
 {
     httpTransport = new HttpTransportBindingElement();
     httpsTransport = new HttpsTransportBindingElement();
     messageEncoding = WSHttpBindingDefaults.MessageEncoding;
     txFlow = GetDefaultTransactionFlowBindingElement();
     session = new ReliableSessionBindingElement(true);
     textEncoding = new TextMessageEncodingBindingElement();
     textEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     mtomEncoding = new MtomMessageEncodingBindingElement();
     mtomEncoding.MessageVersion = MessageVersion.Soap12WSAddressing10;
     reliableSession = new OptionalReliableSession(session);
 }
Example #16
0
        public static List<WSHttpBinding> GetWsHttpBindings(string exeConfigPath)
        {
            var svcSection = Read.Config.ExeConfig.GetServiceModelSection(exeConfigPath);

            var configs = new List<WSHttpBinding>();
            foreach (
                var section in
                    svcSection.Bindings.WSHttpBinding.ConfiguredBindings
                        .Cast<WSHttpBindingElement>())
            {
                var df = new WSHttpBinding();
                var binding = new WSHttpBinding
                {
                    Name = section.Name,

                    MaxBufferPoolSize = section.MaxBufferPoolSize > 0 ? section.MaxBufferPoolSize : df.MaxBufferPoolSize,
                    MaxReceivedMessageSize = section.MaxReceivedMessageSize > 0 ? section.MaxReceivedMessageSize : df.MaxReceivedMessageSize,
                    CloseTimeout = section.CloseTimeout != TimeSpan.Zero ? section.CloseTimeout : df.CloseTimeout,
                    OpenTimeout = section.OpenTimeout != TimeSpan.Zero ? section.OpenTimeout : df.OpenTimeout,
                    SendTimeout = section.SendTimeout != TimeSpan.Zero ? section.SendTimeout : df.SendTimeout,
                    ReceiveTimeout =
                        section.ReceiveTimeout != TimeSpan.Zero ? section.ReceiveTimeout : df.ReceiveTimeout,

                    TextEncoding = section.TextEncoding ?? df.TextEncoding,

                    MessageEncoding = section.MessageEncoding,
                    AllowCookies = section.AllowCookies,
                    BypassProxyOnLocal = section.BypassProxyOnLocal,
                    TransactionFlow = section.TransactionFlow,
                    HostNameComparisonMode = section.HostNameComparisonMode,
                    UseDefaultWebProxy = section.UseDefaultWebProxy,
                };

                var readerQuotasSection = section.ReaderQuotas;
                var readerQuotas = new System.Xml.XmlDictionaryReaderQuotas();
                if (readerQuotasSection != null && readerQuotasSection.MaxDepth > 0)
                {
                    readerQuotas.MaxDepth = readerQuotasSection.MaxDepth;
                    readerQuotas.MaxStringContentLength = readerQuotasSection.MaxStringContentLength;
                    readerQuotas.MaxArrayLength = readerQuotasSection.MaxArrayLength;
                    readerQuotas.MaxBytesPerRead = readerQuotasSection.MaxBytesPerRead;
                    readerQuotas.MaxNameTableCharCount = readerQuotasSection.MaxNameTableCharCount;
                }
                else
                {
                    readerQuotas = null;
                }

                var reliableSessionSection = section.ReliableSession;
                var dfRss = new OptionalReliableSession();
                var reliableSession = new OptionalReliableSession
                {
                    Enabled = reliableSessionSection.Enabled,
                    Ordered = reliableSessionSection.Ordered,
                    InactivityTimeout =
                        reliableSessionSection.InactivityTimeout != TimeSpan.Zero
                            ? reliableSessionSection.InactivityTimeout
                            : dfRss.InactivityTimeout,
                };

                var messageSection = section.Security.Message;
                var message = new NonDualMessageSecurityOverHttp
                {
                    EstablishSecurityContext = messageSection.EstablishSecurityContext,
                    ClientCredentialType = messageSection.ClientCredentialType,
                    NegotiateServiceCredential = messageSection.NegotiateServiceCredential,
                    AlgorithmSuite = messageSection.AlgorithmSuite
                };

                var transportSection = section.Security.Transport;
                var transport = new HttpTransportSecurity
                {
                    ClientCredentialType = transportSection.ClientCredentialType,
                    ProxyCredentialType = transportSection.ProxyCredentialType
                };

                var wsHttpSecuritySection = section.Security;
                var wsHttpSecurity = new WSHttpSecurity
                {
                    Mode = wsHttpSecuritySection.Mode,
                    Transport = transport,
                    Message = message
                };
                ;
                binding.Security = wsHttpSecurity;
                if (readerQuotas != null)
                {
                    binding.ReaderQuotas = readerQuotas;
                }
                binding.ReliableSession = reliableSession;

                configs.Add(binding);
            }
            return configs;
        }
		// Methods

		internal void ApplyConfiguration (OptionalReliableSession s)
		{
			base.ApplyConfiguration (s);
			s.Enabled = this.Enabled;
		}
Example #18
0
		protected WSHttpBindingBase (bool reliableSessionEnabled)
		{
			reliable_session = new OptionalReliableSession (rel_element);
			reliable_session.Enabled = reliableSessionEnabled;
		}
Example #19
0
 internal void CopySettings(OptionalReliableSession copyFrom)
 {
     base.CopySettings(copyFrom);
     this.Enabled = copyFrom.Enabled;
 }
 private void Initialize()
 {
     this.transport = new TcpTransportBindingElement();
     this.encoding = new BinaryMessageEncodingBindingElement();
     this.context = GetDefaultTransactionFlowBindingElement();
     this.session = new ReliableSessionBindingElement();
     this.reliableSession = new OptionalReliableSession(this.session);
 }