Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
BasicHttpBinding Class
Collapse the table of content
Expand the table of content

BasicHttpBinding Class

Represents a binding that a Silverlight 5 client can use to configure endpoints that can communicate with ASMX-based Web services and other services that conform to the WS-I Basic Profile 1.1.

System.Object
  System.ServiceModel.Channels.Binding
    System.ServiceModel.BasicHttpBinding

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

'Declaration
Public Class BasicHttpBinding _
	Inherits Binding

The BasicHttpBinding type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneBasicHttpBindingInitializes a new instance of the BasicHttpBinding class.
Public methodSupported by Silverlight for Windows PhoneBasicHttpBinding(BasicHttpSecurityMode)Initializes a new instance of the BasicHttpBinding class with a specified type of security used by the binding.
Top

  NameDescription
Public propertySupported by Silverlight for Windows PhoneCloseTimeoutGets or sets the interval of time provided for a connection to close before the transport raises an exception. (Inherited from Binding.)
Public propertySupported by Silverlight for Windows PhoneEnableHttpCookieContainerGets or sets a value that indicates whether the [T:P:System.ServiceModel.BasicHttpBinding] will include the HttpCookieContainerBindingElement.
Public propertySupported by Silverlight for Windows PhoneEnvelopeVersionGets the version of SOAP that is used for messages that are processed by this binding.
Public propertySupported by Silverlight for Windows PhoneMaxBufferSizeGets or sets the maximum size for a buffer that receives messages from the channel.
Public propertySupported by Silverlight for Windows PhoneMaxReceivedMessageSizeGets or sets the maximum size for a message that can be received on a channel configured with this binding.
Public propertySupported by Silverlight for Windows PhoneMessageVersionGets the message version used by clients and services configured with the binding. (Inherited from Binding.)
Public propertySupported by Silverlight for Windows PhoneNameGets or sets the name of the binding. (Inherited from Binding.)
Public propertySupported by Silverlight for Windows PhoneNamespaceGets or sets the XML namespace of the binding. (Inherited from Binding.)
Public propertySupported by Silverlight for Windows PhoneOpenTimeoutGets or sets the interval of time provided for a connection to open before the transport raises an exception. (Inherited from Binding.)
Public propertySupported by Silverlight for Windows PhoneReceiveTimeoutGets 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.)
Public propertySupported by Silverlight for Windows PhoneSchemeGets the URI transport scheme for the channels and listeners that are configured with this binding. (Overrides Binding.Scheme.)
Public propertySupported by Silverlight for Windows PhoneSecurityGets the type of security used with this binding.
Public propertySupported by Silverlight for Windows PhoneSendTimeoutGets or sets the interval of time provided for a write operation to complete before the transport raises an exception. (Inherited from Binding.)
Public propertySupported by Silverlight for Windows PhoneTextEncodingGets or sets the character encoding that is used for the message text.
Public propertyTransferModeGets or sets a value that indicates whether messages are sent buffered or streamed.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneBuildChannelFactory(Of 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.)
Public methodSupported by Silverlight for Windows PhoneBuildChannelFactory(Of 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.)
Public methodSupported by Silverlight for Windows PhoneCanBuildChannelFactory(Of 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.)
Public methodSupported by Silverlight for Windows PhoneCanBuildChannelFactory(Of 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.)
Public methodSupported by Silverlight for Windows PhoneCreateBindingElementsReturns an ordered collection of binding elements contained in the current binding. (Overrides Binding.CreateBindingElements.)
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetProperty(Of T)Returns a typed object requested, if present, from the appropriate layer in the binding stack. (Inherited from Binding.)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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 that expose 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 by 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.



			Dim binding As New BasicHttpBinding()

			Dim transportSecurityBinding As New BasicHttpBinding(BasicHttpSecurityMode.Transport)

			Dim envelopeVersion As EnvelopeVersion = binding.EnvelopeVersion
			'Output of TxtEV to TextBlock: Soap11 (http://schemas.xmlsoap.org/soap/evelope/)
			Dim TxtEV As String = envelopeVersion.ToString()

			' Get default MaxBufferSize
			Dim maxBufferSize As Integer = binding.MaxBufferSize
			'Output of txtMBS to TextBlock: 65536
			Dim txtMBS As String = maxBufferSize.ToString()

			' Set new MaxBufferSize
			binding.MaxReceivedMessageSize = 4096
			Dim txtNewMBS As String = binding.MaxReceivedMessageSize.ToString()


			' Get default MaxReceivedMessageSize
			Dim maxReceivedBufferSize As Long = binding.MaxReceivedMessageSize
			'Output of txtMBS: 65536
			Dim txtMRBS As String = maxReceivedBufferSize.ToString()

			' Set new MaxReceivedMessageSize
			binding.MaxReceivedMessageSize = 4096
			Dim txtNewMRBS As String = binding.MaxReceivedMessageSize.ToString()


			' Get Scheme value
			' Output of txtScheme: http
			Dim txtScheme As String = binding.Scheme



			Dim bDefaultHttpBinding As New BasicHttpBinding()
			'Output txtSecurityMode: None
			Dim txtDefaultSecurityMode As String = bDefaultHttpBinding.Security.Mode.ToString()

			Dim bTHttpBinding As New BasicHttpBinding(BasicHttpSecurityMode.Transport)
			'Output txtSecurityMode: Transport
			Dim txtTSecurityMode As String = bTHttpBinding.Security.Mode.ToString()

			Dim bTOHttpBinding As New BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly)
			'Output txtSecurityMode: TransportCredentialOnly
			Dim txtTOSecurityMode As String = bTOHttpBinding.Security.Mode.ToString()



			'Gets the character encoding for the binding
			Dim encoding As Encoding = binding.TextEncoding
			'Output txtEncoding: System.Text.UTF8Encoding
			Dim txtEncoding As String = encoding.ToString()
			Dim unicodeEncoding As Encoding = New UnicodeEncoding()
			'Set a Unicode encoding for the binding
			binding.TextEncoding = unicodeEncoding
			'Output txtEncoding: System.Text.UnicodeEncoding
			Dim txtUEncoding As String = binding.TextEncoding.ToString()



			Dim basicEHBinding As New BasicHttpBinding()
			Dim bindingEC As BindingElementCollection = basicEHBinding.CreateBindingElements()
			'Check on binding elements contained in the collection
			Dim boolHTBE As Boolean = bindingEC.Contains(GetType(HttpTransportBindingElement))
			'Returns true
			Dim txtboolHTBE As String = boolHTBE.ToString()
			Dim boolHSTBE As Boolean = bindingEC.Contains(GetType(HttpsTransportBindingElement))
			'Returns false
			Dim txtboolHSTBE As String = boolHSTBE.ToString()



Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2015 Microsoft