CustomBinding Class
TOC
Collapse the table of content
Expand the table of content

CustomBinding Class

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

Defines a binding from a list of binding elements.

System::Object
  System.ServiceModel.Channels::Binding
    System.ServiceModel.Channels::CustomBinding

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

No code example is currently available or this language may not be supported.

The CustomBinding type exposes the following members.

  NameDescription
Public methodCustomBinding()Initializes a new instance of the CustomBinding class.
Public methodCustomBinding(Binding)Initializes a new instance of the CustomBinding class from the values of a specified binding.
Public methodCustomBinding(array<BindingElement>)Initializes a new instance of the CustomBinding class from an array of binding elements.
Public methodCustomBinding(IEnumerable<BindingElement>)Initializes a new instance of the CustomBinding class with the binding elements from a complete channel stack.
Public methodCustomBinding(String, String, array<BindingElement>)Initializes a new instance of the CustomBinding class from an array of binding elements with a specified name and namespace.
Top

  NameDescription
Public propertyCloseTimeoutGets or sets the interval of time provided for a connection to close before the transport raises an exception. (Inherited from Binding.)
Public propertyElementsGets the binding elements from the custom binding.
Public propertyMessageVersionGets the message version used by clients and services configured with the binding. (Inherited from Binding.)
Public propertyNameGets or sets the name of the binding. (Inherited from Binding.)
Public propertyNamespaceGets or sets the XML namespace of the binding. (Inherited from Binding.)
Public propertyOpenTimeoutGets or sets the interval of time provided for a connection to open before the transport raises an exception. (Inherited from Binding.)
Public propertyReceiveTimeoutGets 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 propertySchemeGets the URI scheme for transport used by the custom binding. (Overrides Binding::Scheme.)
Public propertySendTimeoutGets or sets the interval of time provided for a write operation to complete before the transport raises an exception. (Inherited from Binding.)
Top

  NameDescription
Public methodBuildChannelFactory<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 methodBuildChannelFactory<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.)
Public methodCanBuildChannelFactory<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 methodCanBuildChannelFactory<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.)
Public methodCreateBindingElementsReturns a generic collection of the binding elements from the custom binding. (Overrides Binding::CreateBindingElements().)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetProperty<T>Returns a typed object requested, if present, from the appropriate layer in the binding stack. (Inherited from Binding.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Use a custom binding when one of the system-provided bindings does not meet the requirements of your client. A custom binding could be used, for example, to enable the use of a new encoder to access a service endpoint.

A custom binding is constructed using one of the CustomBinding from a collection of binding elements that are "stacked" in a specific order. At the bottom of this stack are the binding elements that specify the message encoder and the transport:

The following table summarizes the options for each layer.

Layer

Options

Required

Encoding

Text, Custom

Yes

Transport

HTTP, HTTPS, Custom

Yes

No code example is currently available or this language may not be supported.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

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

Show:
© 2017 Microsoft