Sdílet prostřednictvím


<basicHttpContextBinding>

Specifying a binding that provides context for the BasicHttpBinding to be exchanged by enabling HTTP cookies as the exchange mechanism.

Schema Hierarchy

<system.serviceModel>
  <bindings>
    <basicHttpContextBinding>

Syntax

<basicHttpContextBinding>
   <binding 
       allowCookies="Boolean"
       bypassProxyOnLocal="Boolean"
       closeTimeout="TimeSpan" 
       envelopeVersion="None/Soap11/Soap12"
       hostNameComparisonMode="StrongWildCard/Exact/WeakWildcard"
       maxBufferPoolSize="Integer"
       maxBufferSize="Integer"
       maxReceivedMessageSize="Integer"
       messageEncoding="Text/Mtom"
       name="string" 
       openTimeout="TimeSpan" 
       proxyAddress="URI"
       receiveTimeout="TimeSpan"
       sendTimeout="TimeSpan"
       textEncoding="UnicodeFffeTextEncoding/Utf16TextEncoding/Utf8TextEncoding"
       transferMode="Buffered/Streamed/StreamedRequest/StreamedResponse"
       useDefaultWebProxy="Boolean"
       <security mode="None/Transport/Message/TransportWithMessageCredential/TransportCredentialOnly">
           <transport clientCredentialType="None/Basic/Digest/Ntlm/Windows/Certificate"
                  proxyCredentialType="None/Basic/Digest/Ntlm/Windows"
                                    realm="string" />
           <message  algorithmSuite="Aes128/Aes192/Aes256/Rsa15Aes128/ Rsa15Aes256/TripleDes"
                                    clientCredentialType="UserName/Certificate"/>
       </security>
       <readerQuotas             maxArrayLength="Integer"            maxBytesPerRead="Integer"            maxDepth="Integer"             maxNameTableCharCount="Integer"                     maxStringContentLength="Integer" />   </binding>
</basicHttpContextBinding>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

allowCookies

A Boolean value that indicates whether the client accepts cookies and propagates them on future requests. The default is false.

You can use this property when you interact with ASMX Web services that use cookies. In this way, you can be sure that the cookies returned from the server are automatically copied to all future client requests for that service.

bypassProxyOnLocal

A Boolean value that indicates whether to bypass the proxy server for local addresses. The default is false.

An Internet resource is local if it has a local address. A local address is one that is on same computer, the local LAN or intranet and is identified, syntactically, by the lack of a period (.) as in the URIs "http://webserver/" and "https://localhost/".

Setting this attribute determines whether endpoints configured with the BasicHttpBinding use the proxy server when accessing local resources. If this attribute is true, requests to local Internet resources do not use the proxy server. Use the host name (rather than localhost) if you want clients to go through a proxy when talking to services on the same machine when this attribute is set to true.

When this attribute is false, all Internet requests are made through the proxy server.

closeTimeout

A TimeSpan value that specifies the interval of time provided for a close operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

envelopeVersion

Specifies the version of SOAP that is used for messages that are processed by this binding. The only valid value is Soap11.

hostnameComparisonMode

Specifies the HTTP hostname comparison mode used to parse URIs. This attribute is of type HostnameComparisonMode, which indicates whether the hostname is used to reach the service when matching on the URI. The default value is StrongWildcard, which ignores the hostname in the match.

maxBufferPoolSize

An integer value that specifies the maximum amount of memory that is allocated for use by the manager of the message buffers that receive messages from the channel. The default value is 524288 (0x80000) bytes.

The Buffer Manager minimizes the cost of using buffers by using a buffer pool. Buffers are required to process messages by the service when they come out of the channel. If there is not sufficient memory in the buffer pool to process the message load, the Buffer Manager must allocate additional memory from the CLR heap, which increases the garbage collection overhead. Extensive allocation from the CLR garbage heap is an indication that the buffer pool size is too small and that performance can be improved with a larger allocation by increasing the limit specified by this attribute.

maxBufferSize

An integer value that specifies the maximum size, in bytes, of a buffer that stores messages while they are processed for an endpoint configured with this binding. The default value is 65,536 bytes.

maxReceivedMessageSize

A positive integer that defines the maximum message size, in bytes, including headers, for a message that can be received on a channel configured with this binding. The sender receives a SOAP fault if the message is too large for the receiver. The receiver drops the message and creates an entry of the event in the trace log. The default is 65,536 bytes.

messageEncoding

Defines the encoder used to encode the SOAP message. Valid values include the following:

  • Text: Use a text message encoder.

  • Mtom: Use a Message Transmission Organization Mechanism 1.0 (MTOM) encoder.

The default is Text. This attribute is of type WSMessageEncoding.

messageVersion

Specifies the message version used by clients and services configured with the binding. This attribute is of type MessageVersion.

name

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. Each binding has a name and namespace attribute that together uniquely identify it in the metadata of the service. In addition, this name is unique among bindings of the same type. 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.

namespace

Specifies the XML namespace of the binding. The default value is "http://tempuri.org/Bindings". Each binding has a name and namespace attribute that together uniquely identify it in the metadata of the service.

openTimeout

A TimeSpan value that specifies the interval of time provided for an open operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

proxyAddress

A URI that contains the address of the HTTP proxy. If useSystemWebProxy is set to true, this setting must be null. The default is null.

receiveTimeout

A TimeSpan value that specifies the interval of time provided for a receive operation to complete. This value should be greater than or equal to Zero. The default is 00:10:00.

sendTimeout

A TimeSpan value that specifies the interval of time provided for a send operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

textEncoding

Sets the character set encoding to be used for emitting messages on the binding. Valid values include the following:

  • BigEndianUnicode: Unicode BigEndian encoding.

  • Unicode: 16-bit encoding.

  • UTF8: 8-bit encoding

The default is UTF8. This attribute is of type Encoding.

transferMode

A valid TransferMode value that specifies whether messages are buffered or streamed on a request or response.

useDefaultWebProxy

A Boolean value that specifies whether the auto-configured HTTP proxy of the system should be used, if available. The default is true.

Child Elements

Element Description

<security> of <basicHttpBinding>

Defines the security settings for the binding. This element is of type BasicHttpSecurityElement.

<readerQuotas>

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.

Parent Elements

Element Description

<bindings>

This element holds a collection of standard and custom bindings.

Remarks

This binding element provides a protection level and an exchange mechanism as part of the context for a BasicHttpBinding.

See Also

Reference

<basicHttpBinding>
BasicHttpBinding
BasicHttpContextBinding
BasicHttpContextBindingElement
ContextBindingElement

Concepts

<binding>

Other Resources

Windows Communication Foundation Bindings
Configuring System-Provided Bindings
Using Bindings to Configure Services and Clients