Defines a secure, reliable, interoperable binding suitable for non-duplex service contracts. The binding implements the following specifications: WS-Reliable Messaging for reliability, and WS-Security for message security and authentication. The transport is HTTP, and message encoding is Text/XML encoding.
<wsHttpBinding> <binding allowCookies="Boolean" bypassProxyOnLocal="Boolean" closeTimeout="TimeSpan" hostNameComparisonMode="StrongWildCard/Exact/WeakWildcard" maxBufferPoolSize="integer" maxReceivedMessageSize="Integer" messageEncoding="Text/Mtom" name="string" openTimeout="TimeSpan" proxyAddress="URI" receiveTimeout="TimeSpan" sendTimeout="TimeSpan" textEncoding="UnicodeFffeTextEncoding/Utf16TextEncoding/Utf8TextEncoding" transactionFlow="Boolean" useDefaultWebProxy="Boolean"> <reliableSession ordered="Boolean" inactivityTimeout="TimeSpan" enabled="Boolean" /> <security mode="Message/None/Transport/TransportWithCredential"> <transport clientCredentialType="Basic/Certificate/Digest/None/Ntlm/Windows" proxyCredentialType="Basic/Digest/None/Ntlm/Windows" realm="string" /> <message algorithmSuite="Basic128/Basic192/Basic256/Basic128Rsa15/Basic256Rsa15/TripleDes/TripleDesRsa15/Basic128Sha256/Basic192Sha256/TripleDesSha256/Basic128Sha256Rsa15/Basic192Sha256Rsa15/Basic256Sha256Rsa15/TripleDesSha256Rsa15" clientCredentialType="Certificate/IssuedToken/None/UserName/Windows" establishSecurityContext="Boolean" negotiateServiceCredential="Boolean" /> </security> <readerQuotas maxArrayLength="Integer" maxBytesPerRead="Integer" maxDepth="Integer" maxNameTableCharCount="Integer" maxStringContentLength="Integer" /> </binding> </wsHttpBinding>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements
A Boolean value that indicates whether the client accepts cookies and propagates them on future requests. The default is false.
A Boolean value that indicates whether to bypass the proxy server for local addresses. The default is false.
Specifies the HTTP hostname comparison mode used to parse URIs. This attribute is of type T:System.ServiceModel.HostnameComparisonMode, which indicates whether the hostname is used to reach the service when matching on the URI. The default value is F:System.ServiceModel.HostnameComparisonMode.StrongWildcard, which ignores the hostname in the match.
An integer that specifies the maximum buffer pool size for this binding. The default is 524,288 bytes (512 * 1024). Many parts of Windows Communication Foundation (WCF) use buffers. Creating and destroying buffers each time they are used is expensive, and garbage collection for buffers is also expensive. With buffer pools, you can take a buffer from the pool, use it, and return it to the pool once you are done. Thus the overhead in creating and destroying buffers is avoided.
A positive integer that specifies the maximum message size, in bytes, including headers, that can be received on a channel configured with this binding. The sender of a message exceeding this limit will receive a SOAP fault. The receiver drops the message and creates an entry of the event in the trace log. The default is 65536.
Defines the encoder used to encode the message. Valid values include the following:
This attribute is of type WSMessageEncoding.
A string that contains the configuration name of the binding. This value should be unique because it is used as an identification for the binding. Starting with .NET Framework 4, bindings and behaviors are not required to have a name. For more information about default configuration and nameless bindings and behaviors, see Simplified Configuration and Simplified Configuration for WCF Services.
A URI that specifies the address of the HTTP proxy. If useSystemWebProxy is true, this setting must be null. The default is null.
Specifies the character set encoding to be used for emitting messages on the binding. Valid values include the following:
The default is Utf8TextEncoding.
This attribute is of type Encoding.
A Boolean value that specifies whether the binding supports flowing WS-Transactions. The default is false.
A Boolean value that specifies whether the system’s auto-configured HTTP proxy is used. The default is true.
Defines the security settings for the binding. This element is of type WSHttpSecurityElement.
Defines the constraints on the complexity of SOAP messages that can be processed by endpoints configured with this binding. This element is of type XmlDictionaryReaderQuotasElement.
Specifies if reliable sessions are established between channel endpoints.
This element holds a collection of standard and custom bindings.
The WSHttpBinding is similar to the BasicHttpBinding but provides more Web service features. It uses the HTTP transport and provides message security, as does BasicHttpBinding, but it also provides transactions, reliable messaging, and WS-Addressing, either enabled by default or available through a single control setting.
<configuration> <system.ServiceModel> <bindings> <wsHttpBinding> <binding closeTimeout="00:00:10" openTimeout="00:00:20" receiveTimeout="00:00:30" sendTimeout="00:00:40" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="WeakWildcard" maxReceivedMessageSize="1000" messageEncoding="Mtom" proxyAddress="http://foo/bar" textEncoding="utf-16" useDefaultWebProxy="false"> <reliableSession ordered="false" inactivityTimeout="00:02:00" enabled="true" /> <security mode="Transport"> <transport clientCredentialType="Digest" proxyCredentialType="None" realm="someRealm" /> <message clientCredentialType="Windows" negotiateServiceCredential="false" algorithmSuite="Aes128" defaultProtectionLevel="None" /> </security> </binding> </wsHttpBinding> </bindings> </system.ServiceModel> </configuration>