/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="description">The description.</param> public UaSoapXmlOverPipeBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { SymmetricSecurityBindingElement bootstrap = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateMutualCertificateBindingElement(); bootstrap.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncryptAndEncryptSignature; bootstrap.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); bootstrap.IncludeTimestamp = true; bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; // bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; bootstrap.RequireSignatureConfirmation = false; bootstrap.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateSecureConversationBindingElement(bootstrap, true); m_security.MessageProtectionOrder = MessageProtectionOrder.EncryptBeforeSign; m_security.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); m_security.IncludeTimestamp = true; m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; // m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; m_security.RequireSignatureConfirmation = false; m_security.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security.SetKeyDerivation(true); } m_encoding = new BinaryMessageEncodingBindingElement(); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new System.ServiceModel.Channels.NamedPipeTransportBindingElement(); m_transport.ManualAddressing = false; m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="description">The description.</param> public UaSoapXmlOverTcpBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { SymmetricSecurityBindingElement bootstrap = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateMutualCertificateBindingElement(); bootstrap.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncryptAndEncryptSignature; bootstrap.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); bootstrap.IncludeTimestamp = true; bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; // bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; bootstrap.RequireSignatureConfirmation = false; bootstrap.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateSecureConversationBindingElement(bootstrap, true); m_security.MessageProtectionOrder = MessageProtectionOrder.EncryptBeforeSign; m_security.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); m_security.IncludeTimestamp = true; m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; // m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; m_security.RequireSignatureConfirmation = false; m_security.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security.SetKeyDerivation(true); } m_encoding = new BinaryMessageEncodingBindingElement(); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new System.ServiceModel.Channels.TcpTransportBindingElement(); m_transport.ManualAddressing = false; m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="descriptions">The descriptions.</param> public UaTcpBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, params EndpointDescription[] descriptions) : base(namespaceUris, factory, configuration) { m_transport = new TcpTransportBindingElement(); m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="descriptions">The descriptions.</param> public UaTcpBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, params EndpointDescription[] descriptions) : base(namespaceUris, factory, configuration) { m_transport = new TcpTransportBindingElement(); m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; }
/// <summary> /// Initializes the binding. /// </summary> protected BaseBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration) { m_messageContext = new ServiceMessageContext(); m_messageContext.MaxStringLength = configuration.MaxStringLength; m_messageContext.MaxByteStringLength = configuration.MaxByteStringLength; m_messageContext.MaxArrayLength = configuration.MaxArrayLength; m_messageContext.MaxMessageSize = configuration.MaxMessageSize; m_messageContext.Factory = factory; m_messageContext.NamespaceUris = namespaceUris; }
/// <summary> /// Initializes the binding. /// </summary> protected BaseBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration) { m_messageContext = new ServiceMessageContext(); m_messageContext.MaxStringLength = configuration.MaxStringLength; m_messageContext.MaxByteStringLength = configuration.MaxByteStringLength; m_messageContext.MaxArrayLength = configuration.MaxArrayLength; m_messageContext.MaxMessageSize = configuration.MaxMessageSize; m_messageContext.Factory = factory; m_messageContext.NamespaceUris = namespaceUris; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="description">The description.</param> public UaHttpsSoapBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { TransportSecurityBindingElement bootstrap = SecurityBindingElement.CreateUserNameOverTransportBindingElement(); bootstrap.IncludeTimestamp = true; bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; bootstrap.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security = SecurityBindingElement.CreateSecureConversationBindingElement(bootstrap); m_security.IncludeTimestamp = true; m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; m_security.SecurityHeaderLayout = SecurityHeaderLayout.Strict; } m_encoding = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new HttpsTransportBindingElement(); m_transport.AllowCookies = false; m_transport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous; m_transport.ManualAddressing = false; m_transport.MaxBufferSize = configuration.MaxMessageSize; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; m_transport.TransferMode = TransferMode.Buffered; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="description">The description.</param> public UaSoapXmlBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { TransportSecurityBindingElement bootstrap = SecurityBindingElement.CreateUserNameOverTransportBindingElement(); bootstrap.IncludeTimestamp = true; bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; bootstrap.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security = SecurityBindingElement.CreateSecureConversationBindingElement(bootstrap); m_security.IncludeTimestamp = true; m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; m_security.SecurityHeaderLayout = SecurityHeaderLayout.Strict; } m_encoding = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new HttpTransportBindingElement(); m_transport.AllowCookies = false; m_transport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous; m_transport.ManualAddressing = false; m_transport.MaxBufferSize = configuration.MaxMessageSize; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; m_transport.TransferMode = TransferMode.Buffered; }
/// <summary> /// Updates the config extension with the new configuration information. /// </summary> private static void UpdateGDSConfigurationDocument(XmlElementCollection extensions, GlobalDiscoveryServerConfiguration gdsConfiguration) { XmlDocument gdsDoc = new XmlDocument(); var qualifiedName = EncodeableFactory.GetXmlName(typeof(GlobalDiscoveryServerConfiguration)); XmlSerializer gdsSerializer = new XmlSerializer(typeof(GlobalDiscoveryServerConfiguration), qualifiedName.Namespace); using (XmlWriter writer = gdsDoc.CreateNavigator().AppendChild()) { gdsSerializer.Serialize(writer, gdsConfiguration); } foreach (var extension in extensions) { if (extension.Name == qualifiedName.Name) { extension.InnerXml = gdsDoc.DocumentElement.InnerXml; } } }
/// <summary> /// Initializes the binding. /// </summary> public UaBasicHttpBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { // TBD } m_encoding = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new HttpTransportBindingElement(); m_transport.AllowCookies = false; m_transport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous; m_transport.BypassProxyOnLocal = true; m_transport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; m_transport.KeepAliveEnabled = true; m_transport.ManualAddressing = false; m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxBufferSize = configuration.MaxMessageSize; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; m_transport.TransferMode = TransferMode.Buffered; m_transport.UseDefaultWebProxy = false; }
/// <summary> /// Initializes the binding. /// </summary> public UaBasicHttpBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { // TBD } m_encoding = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new HttpTransportBindingElement(); m_transport.AllowCookies = false; m_transport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous; m_transport.BypassProxyOnLocal = true; m_transport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; m_transport.KeepAliveEnabled = true; m_transport.ManualAddressing = false; m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxBufferSize = configuration.MaxMessageSize; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; m_transport.TransferMode = TransferMode.Buffered; m_transport.UseDefaultWebProxy = false; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="descriptions">The descriptions.</param> public UaTcpBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, params EndpointDescription[] descriptions) : base(namespaceUris, factory, configuration) { m_transport = new UaTcpTransportBindingElement(); m_transport.MessageContext = base.MessageContext; m_transport.Configuration = configuration; if (descriptions != null) { m_transport.Descriptions = new EndpointDescriptionCollection(descriptions); } m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="descriptions">The descriptions.</param> public UaTcpBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, params EndpointDescription[] descriptions) : base(namespaceUris, factory, configuration) { m_transport = new UaTcpTransportBindingElement(); m_transport.MessageContext = base.MessageContext; m_transport.Configuration = configuration; if (descriptions != null) { m_transport.Descriptions = new EndpointDescriptionCollection(descriptions); } m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="description">The description.</param> public UaSoapXmlBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { SymmetricSecurityBindingElement bootstrap = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateMutualCertificateBindingElement(); bootstrap.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncryptAndEncryptSignature; bootstrap.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); bootstrap.IncludeTimestamp = true; bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; bootstrap.RequireSignatureConfirmation = false; bootstrap.SecurityHeaderLayout = SecurityHeaderLayout.Strict; bootstrap.SetKeyDerivation(true); m_security = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateSecureConversationBindingElement(bootstrap, true); m_security.MessageProtectionOrder = MessageProtectionOrder.EncryptBeforeSign; m_security.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); m_security.IncludeTimestamp = true; m_security.KeyEntropyMode = SecurityKeyEntropyMode.CombinedEntropy; m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; m_security.RequireSignatureConfirmation = false; m_security.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security.SetKeyDerivation(true); } m_encoding = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new HttpTransportBindingElement(); m_transport.AllowCookies = false; m_transport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous; m_transport.BypassProxyOnLocal = true; m_transport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; m_transport.KeepAliveEnabled = true; m_transport.ManualAddressing = false; m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxBufferSize = configuration.MaxMessageSize; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; m_transport.TransferMode = TransferMode.Buffered; m_transport.UseDefaultWebProxy = false; }
/// <summary> /// Initializes the binding. /// </summary> /// <param name="namespaceUris">The namespace uris.</param> /// <param name="factory">The factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="description">The description.</param> public UaSoapXmlBinding( NamespaceTable namespaceUris, EncodeableFactory factory, EndpointConfiguration configuration, EndpointDescription description) : base(namespaceUris, factory, configuration) { if (description != null && description.SecurityMode != MessageSecurityMode.None) { SymmetricSecurityBindingElement bootstrap = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateMutualCertificateBindingElement(); bootstrap.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncryptAndEncryptSignature; bootstrap.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); bootstrap.IncludeTimestamp = true; bootstrap.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; bootstrap.RequireSignatureConfirmation = false; bootstrap.SecurityHeaderLayout = SecurityHeaderLayout.Strict; bootstrap.SetKeyDerivation(true); m_security = (SymmetricSecurityBindingElement)SecurityBindingElement.CreateSecureConversationBindingElement(bootstrap, true); m_security.MessageProtectionOrder = MessageProtectionOrder.EncryptBeforeSign; m_security.DefaultAlgorithmSuite = SecurityPolicies.ToSecurityAlgorithmSuite(description.SecurityPolicyUri); m_security.IncludeTimestamp = true; m_security.KeyEntropyMode = SecurityKeyEntropyMode.CombinedEntropy; m_security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; m_security.RequireSignatureConfirmation = false; m_security.SecurityHeaderLayout = SecurityHeaderLayout.Strict; m_security.SetKeyDerivation(true); } m_encoding = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8); // WCF does not distinguish between arrays and byte string. int maxArrayLength = configuration.MaxArrayLength; if (configuration.MaxArrayLength < configuration.MaxByteStringLength) { maxArrayLength = configuration.MaxByteStringLength; } m_encoding.ReaderQuotas.MaxArrayLength = maxArrayLength; m_encoding.ReaderQuotas.MaxStringContentLength = configuration.MaxStringLength; m_encoding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue; m_encoding.ReaderQuotas.MaxDepth = Int32.MaxValue; m_encoding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue; m_transport = new HttpTransportBindingElement(); m_transport.AllowCookies = false; m_transport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous; m_transport.BypassProxyOnLocal = true; m_transport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard; m_transport.KeepAliveEnabled = true; m_transport.ManualAddressing = false; m_transport.MaxBufferPoolSize = Int32.MaxValue; m_transport.MaxBufferSize = configuration.MaxMessageSize; m_transport.MaxReceivedMessageSize = configuration.MaxMessageSize; m_transport.TransferMode = TransferMode.Buffered; m_transport.UseDefaultWebProxy = false; }