This element contains a collection of customized binding elements and provides full control over the messaging stack for a Silverlight application.
<customBinding> <binding name="string" closeTimeout="TimeSpan" openTimeout="TimeSpan" receiveTimeout="TimeSpan" sendTimeout="TimeSpan"> <binaryMessageEncoding /> <httpTransport maxBufferSize="Integer" maxReceivedMessageSize="long" /> <httpsTransport maxBufferSize="Integer" maxReceivedMessageSize="long"> </httpsTransport> <security authenticationMode="string " /> <textMessageEncoding messageVersion="string" writeEncoding="string" /> </binding> </customBinding>
The following sections describe attributes, child elements, and parent elements.
This element contains a custom binding for Silverlight application.
This element contains the collection of custom bindings for a Silverlight application. Each binding in the collection is identified by its unique name attribute.
Custom bindings provide full control over the Silverlight messaging stack. Special tailored bindings can be created my adding the configuration elements for specific entities. For example, the user can combine the httpsTransport section and the security section to create a secure HTTPS-based binding.
An individual binding defines the message stack by specifying the configuration elements for the stack elements in the order they appear on the stack. Each element defines and configures the one element of the stack. There must be only one transport element in each custom binding. Without this element, the messaging stack is incomplete.
The order in which elements appear in the stack matters, because it is the order in which operations are applied to the message. The recommended order of stack elements is the following:
The following example demonstrates how to configure a custom binding.
<configuration> <system.serviceModel> <bindings> <!-- configure a custom binding --> <customBinding> <binding name="CustomBinding1" closeTimeout="00:05:00" > <httpTransport maxBufferSize="400000" /> <security authenticationMode="UserNameOverTransport" /> </binding> </customBinding> </bindings> </system.serviceModel> </configuration>