BasicHttpBinding Class
Represents a binding that a 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::BasicHttpBinding
System.ServiceModel::BasicHttpContextBinding
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. |
![]() | BypassProxyOnLocal | Gets or sets a value that indicates whether to bypass the proxy server for local addresses. |
![]() ![]() | CloseTimeout | Gets or sets the interval of time provided for a connection to close before the transport raises an exception. (Inherited from Binding.) |
![]() ![]() | EnvelopeVersion | Gets the version of SOAP that is used for messages that are processed by this binding. |
![]() | HostNameComparisonMode | Gets or sets a value that indicates whether the hostname is used to reach the service when matching the URI. |
![]() | MaxBufferPoolSize | Gets or sets the maximum amount of memory that is allocated for use by the manager of the message buffers that receive messages from the channel. |
![]() ![]() | MaxBufferSize | Gets or sets the maximum size for a buffer that receives messages from the channel. |
![]() ![]() | MaxReceivedMessageSize | Gets or sets the maximum size for a message that can be received on a channel configured with this binding. |
![]() | 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. |
![]() | ReaderQuotas | Gets or sets constraints on the complexity of SOAP messages that can be processed by endpoints configured with this binding. |
![]() ![]() | 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. (Overrides Binding::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. |
![]() | TransferMode | Gets or sets a value that indicates whether messages are sent buffered or streamed. |
![]() | UseDefaultWebProxy | Gets or sets a value that indicates whether the auto-configured HTTP proxy of the system should be used, if available. |
| 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. (Inherited from Binding.) |
![]() ![]() | BuildChannelFactory<TChannel>(array<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>(array<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, array<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, array<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, array<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>(array<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>(array<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 | 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.) |
![]() | 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. |
![]() | 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. |
![]() ![]() | 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. |
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 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 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


