BasicHttpBinding Class
Represents a binding that a Windows Communication Foundation (WCF) service can use to configure and expose endpoints that are able to communicate with ASMX-based Web services and clients and other services that conform to the WS-I Basic Profile 1.1.
System.ServiceModel.Channels.Binding
System.ServiceModel.HttpBindingBase
System.ServiceModel.BasicHttpBinding
System.ServiceModel.BasicHttpContextBinding
Namespace: System.ServiceModel
Assembly: System.ServiceModel (in System.ServiceModel.dll)
The BasicHttpBinding type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | BasicHttpBinding() | Initializes a new instance of the BasicHttpBinding class. |
![]() ![]() ![]() | BasicHttpBinding(BasicHttpSecurityMode) | Initializes a new instance of the BasicHttpBinding class with a specified type of security used by the binding. |
![]() | BasicHttpBinding(String) | Initializes a new instance of the BasicHttpBinding class with a binding specified by its configuration name. |
| Name | Description | |
|---|---|---|
![]() | AllowCookies | Gets or sets a value that indicates whether the client accepts cookies and propagates them on future requests. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is AllowCookies. |
![]() | BypassProxyOnLocal | Gets or sets a value that indicates whether to bypass the proxy server for local addresses. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is BypassProxyOnLocal. |
![]() ![]() ![]() | CloseTimeout | Gets or sets the interval of time provided for a connection to close before the transport raises an exception. (Inherited from Binding.) |
![]() | EnableHttpCookieContainer | Obsolete. Gets or sets a value that indicates whether HTTP cookie container is enabled. |
![]() ![]() | EnvelopeVersion | Gets the version of SOAP that is used for messages that are processed by this binding. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is EnvelopeVersion. In Portable Class Library Portable Class Library, this member is EnvelopeVersion. |
![]() | HostNameComparisonMode | Gets or sets a value that indicates whether the hostname is used to reach the service when matching the URI. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is HostNameComparisonMode. |
![]() | MaxBufferPoolSize | Gets or sets the maximum amount of memory, in bytes, that is allocated for use by the manager of the message buffers that receive messages from the channel. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is MaxBufferPoolSize. |
![]() ![]() | MaxBufferSize | Gets or sets the maximum size, in bytes, for a buffer that receives messages from the channel. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is MaxBufferSize. In Portable Class Library Portable Class Library, this member is MaxBufferSize. |
![]() ![]() | MaxReceivedMessageSize | Gets or sets the maximum size, in bytes, for a message that can be received on a channel configured with this binding. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is MaxReceivedMessageSize. In Portable Class Library Portable Class Library, this member is MaxReceivedMessageSize. |
![]() | MessageEncoding | Gets or sets whether MTOM or Text is used to encode SOAP messages. |
![]() ![]() ![]() | MessageVersion | Gets the message version used by clients and services configured with the binding. (Inherited from Binding.) |
![]() ![]() ![]() | Name | Gets or sets the name of the binding. (Inherited from Binding.) |
![]() ![]() ![]() | Namespace | Gets or sets the XML namespace of the binding. (Inherited from Binding.) |
![]() ![]() ![]() | OpenTimeout | Gets or sets the interval of time provided for a connection to open before the transport raises an exception. (Inherited from Binding.) |
![]() | ProxyAddress | Gets or sets the URI address of the HTTP proxy. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is ProxyAddress. |
![]() | ReaderQuotas | Gets or sets the constraints on the complexity of SOAP messages that can be processed by endpoints configured with this binding. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is ReaderQuotas. |
![]() ![]() ![]() | ReceiveTimeout | Gets or sets the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped. (Inherited from Binding.) |
![]() ![]() | Scheme | Gets the URI transport scheme for the channels and listeners that are configured with this binding. (Inherited from HttpBindingBase.) In .NET Framework Client Profile, this member is overridden by Scheme. In Portable Class Library, this member is overridden by Scheme. |
![]() ![]() ![]() | Security | Gets the type of security used with this binding. |
![]() ![]() ![]() | SendTimeout | Gets or sets the interval of time provided for a write operation to complete before the transport raises an exception. (Inherited from Binding.) |
![]() ![]() | TextEncoding | Gets or sets the character encoding that is used for the message text. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is TextEncoding. In Portable Class Library Portable Class Library, this member is TextEncoding. |
![]() | TransferMode | Gets or sets a value that indicates whether messages are sent buffered or streamed. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is TransferMode. |
![]() | UseDefaultWebProxy | Gets or sets a value that indicates whether the auto-configured HTTP proxy of the system should be used, if available. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is UseDefaultWebProxy. |
| Name | Description | |
|---|---|---|
![]() ![]() | BuildChannelFactory(TChannel)(BindingParameterCollection) | Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by a collection of binding parameters. (Overrides Binding.BuildChannelFactory(TChannel)(BindingParameterCollection).) In .NET Framework Client Profile 4, this member is inherited from Binding.BuildChannelFactory(TChannel)(BindingParameterCollection). In Portable Class Library Portable Class Library, this member is inherited from Binding.BuildChannelFactory(TChannel)(BindingParameterCollection). |
![]() ![]() ![]() | BuildChannelFactory(TChannel)(Object[]) | Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by an object array. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified by a collection of binding parameters. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(Object[]) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(Uri, Object[]) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(Uri, BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(Uri, String, Object[]) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(Uri, String, BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(Uri, String, ListenUriMode, Object[]) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener(TChannel)(Uri, String, ListenUriMode, BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() ![]() ![]() | CanBuildChannelFactory(TChannel)(BindingParameterCollection) | Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the collection of binding parameters specified. (Inherited from Binding.) |
![]() ![]() ![]() | CanBuildChannelFactory(TChannel)(Object[]) | Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the requirements specified by an object array. (Inherited from Binding.) |
![]() | CanBuildChannelListener(TChannel)(BindingParameterCollection) | Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the collection of binding parameters specified. (Inherited from Binding.) |
![]() | CanBuildChannelListener(TChannel)(Object[]) | Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the criteria specified in an array of objects. (Inherited from Binding.) |
![]() ![]() ![]() | CreateBindingElements | Creates and returns an ordered collection of binding elements contained in the current binding. (Overrides Binding.CreateBindingElements().) |
![]() ![]() ![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() ![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() ![]() | GetProperty(T) | Returns a typed object requested, if present, from the appropriate layer in the binding stack. (Inherited from Binding.) |
![]() ![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ShouldSerializeEnableHttpCookieContainer | Indicates whether the http cookie container should enable the serialization. |
![]() | ShouldSerializeName | Returns whether the name of the binding should be serialized. (Inherited from Binding.) |
![]() | ShouldSerializeNamespace | Returns whether the namespace of the binding should be serialized. (Inherited from Binding.) |
![]() | ShouldSerializeReaderQuotas | Returns whether the constraint values placed on the complexity of SOAP message structure should be serialized. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is ShouldSerializeReaderQuotas(). |
![]() | ShouldSerializeSecurity | Returns whether security settings should be serialized based upon whether serialization already occurs, for example at the message or transport level. |
![]() | ShouldSerializeTextEncoding | Returns whether settings for text encoding should be serialized. (Inherited from HttpBindingBase.) In .NET Framework Client Profile 4, this member is ShouldSerializeTextEncoding(). |
![]() ![]() ![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IBindingRuntimePreferences.ReceiveSynchronously | Gets a value that indicates whether incoming requests are handled synchronously or asynchronously. (Inherited from HttpBindingBase.) |
![]() ![]() | IBindingRuntimePreferences.ReceiveSynchronously | Gets a value that indicates whether incoming requests are handled synchronously or asynchronously. |
The BasicHttpBinding uses HTTP as the transport for sending SOAP 1.1 messages. A service can use this binding to expose endpoints that conform to WS-I BP 1.1, such as those that ASMX clients access. Similarly, a client can use the BasicHttpBinding to communicate with services exposing endpoints that conform to WS-I BP 1.1, such as ASMX Web services or Windows Communication Foundation (WCF) services configured with the BasicHttpBinding.
Security is turned off by default, but can be added setting the BasicHttpSecurityMode to a value other than None in the BasicHttpBinding(BasicHttpSecurityMode) constructor. It uses a "Text" message encoding and UTF-8 text encoding by default.
The following example shows how to configure the BasicHttpBinding in an application configuration file.
<system.serviceModel>
<services>
<service
name="Microsoft.ServiceModel.Samples.CalculatorService"
behaviorConfiguration="CalculatorServiceBehavior">
<!-- use base address provided by host -->
<!-- specify BasicHttp binding and a binding configuration to use -->
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="Binding1"
contract="Microsoft.ServiceModel.Samples.ICalculator" />
</service>
</services>
<bindings>
<!--
Following is the expanded configuration section for a BasicHttpBinding.
Each property is configured with the default value.
See the TransportSecurity, and MessageSecurity samples in the
Basic directory to learn how to configure these features.
-->
<basicHttpBinding>
<binding name="Binding1"
hostNameComparisonMode="StrongWildcard"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
openTimeout="00:10:00"
closeTimeout="00:10:00"
maxReceivedMessageSize="65536"
maxBufferSize="65536"
maxBufferPoolSize="524288"
transferMode="Buffered"
messageEncoding="Text"
textEncoding="utf-8"
bypassProxyOnLocal="false"
useDefaultWebProxy="true" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<!--For debugging purposes set the returnUnknownExceptionsAsFaults attribute to true-->
<behaviors>
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
The following example shows how to programmatically configure BasicHttpBinding.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.gif?cs-save-lang=1&cs-lang=fsharp)
.png?cs-save-lang=1&cs-lang=fsharp)
.png?cs-save-lang=1&cs-lang=fsharp)
.gif?cs-save-lang=1&cs-lang=fsharp)
.gif?cs-save-lang=1&cs-lang=fsharp)
.gif?cs-save-lang=1&cs-lang=fsharp)
.gif?cs-save-lang=1&cs-lang=fsharp)