CreateBindingElements Method
Collapse the table of content
Expand the table of content

BasicHttpBinding.CreateBindingElements Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns an ordered collection of binding elements contained in the current binding.

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

'Declaration
Public Overrides Function CreateBindingElements As BindingElementCollection

Return Value

Type: System.ServiceModel.Channels.BindingElementCollection
The BindingElementCollection that contains the ordered stack of binding elements described by the BasicHttpBinding.

The order of the binding elements is important. It reflects the order in which the protocol and transport channels are constructed and stacked. This collection of binding elements creates a new collection each time it is called and can be modified and then used to create a CustomBinding.


			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()


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft