BinaryMessageEncodingBindingElement Class

 

The binding element that specifies the .NET Binary Format for XML used to encode messages.

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

System.Object
  System.ServiceModel.Channels.BindingElement
    System.ServiceModel.Channels.MessageEncodingBindingElement
      System.ServiceModel.Channels.BinaryMessageEncodingBindingElement

public sealed class BinaryMessageEncodingBindingElement : MessageEncodingBindingElement, 
	IWsdlExportExtension, IPolicyExportExtension

NameDescription
System_CAPS_pubmethodBinaryMessageEncodingBindingElement()

Initializes a new instance of the BinaryMessageEncodingBindingElement class.

NameDescription
System_CAPS_pubpropertyCompressionFormat

Gets or sets the compression format for the binding element.

System_CAPS_pubpropertyMaxReadPoolSize

Gets or sets the maximum number of XML readers that are allocated to a pool and are ready for use to process incoming messages.

System_CAPS_pubpropertyMaxSessionSize

Gets or sets the maximum amount of memory available within a session for optimizing transmission procedures.

System_CAPS_pubpropertyMaxWritePoolSize

Gets or sets the maximum number of XML writers that are allocated to a pool and are ready for use to process outgoing messages.

System_CAPS_pubpropertyMessageVersion

Gets or sets the SOAP message and WS-Addressing versions that are used or expected.(Overrides MessageEncodingBindingElement.MessageVersion.)

System_CAPS_pubpropertyReaderQuotas

Gets constraints on the complexity of XML messages that can be processed by endpoints configured with this binding element.

NameDescription
System_CAPS_pubmethodBuildChannelFactory<TChannel>(BindingContext)

Builds the channel factory stack on the client that creates a specified type of channel for a specified context.(Overrides BindingElement.BuildChannelFactory<TChannel>(BindingContext).)

System_CAPS_pubmethodBuildChannelListener<TChannel>(BindingContext)

Builds the channel listener on the service that accepts a specified type of channel for a specified context.(Overrides BindingElement.BuildChannelListener<TChannel>(BindingContext).)

System_CAPS_pubmethodCanBuildChannelFactory<TChannel>(BindingContext)

Returns a value that indicates whether the binding element can build a channel factory for a specific type of channel.(Inherited from BindingElement.)

System_CAPS_pubmethodCanBuildChannelListener<TChannel>(BindingContext)

Returns a value that indicates whether the current binding can build a listener for a specified type of channel and context.(Overrides BindingElement.CanBuildChannelListener<TChannel>(BindingContext).)

System_CAPS_pubmethodClone()

Creates a new BinaryMessageEncodingBindingElement object initialized from the current one.(Overrides BindingElement.Clone().)

System_CAPS_pubmethodCreateMessageEncoderFactory()

Creates a factory for binary message encoders that employ the SOAP and WS-Addressing versions and the character encoding specified by the current encoding binding element.(Overrides MessageEncodingBindingElement.CreateMessageEncoderFactory().)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetProperty<T>(BindingContext)

Returns a typed object requested, if present, from the appropriate layer in the binding element stack.(Overrides MessageEncodingBindingElement.GetProperty<T>(BindingContext).)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodShouldSerializeMessageVersion()

Returns whether the SOAP message structure version should be serialized.

System_CAPS_pubmethodShouldSerializeReaderQuotas()

Returns whether the values of constraints placed on the complexity of SOAP message structure should be serialized.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext)

Writes a custom binary message encoding elements into the generated metadata for an endpoint.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext)

Writes a custom binary message encoding elements into the generated WSDL for a contract.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext)

Writes a custom binary message encoding elements into the generated WSDL for an endpoint.

Encoding is the process of transforming a message into a sequence of bytes. Decoding is the reverse process. Windows Communication Foundation (WCF) includes three types of encoding for SOAP messages: Text, Binary and Message Transmission Optimization Mechanism (MTOM).

The BinaryMessageEncodingBindingElement is the binding element that specified the .NET Binary Format for XML should be used for encoding messages, and has options to specify the character encoding and the SOAP and WS-Addressing version to be used. Binary encoding is most efficient but least interoperable of the encoding options.

For more information about the binding element that specifies messages are encoded using a textual representation of XML, see TextMessageEncodingBindingElement.

For more information about the binding element that specifies messages are encoded using the MTOM message encoding, see MtomMessageEncodingBindingElement.

To implement a custom message encoder, use the MessageEncodingBindingElement class.

BinaryMessageEncodingBindingElement be = new BinaryMessageEncodingBindingElement();
be.MaxReadPoolSize = 16;
be.MaxSessionSize = 2048;
be.MaxWritePoolSize = 16;
be.MessageVersion = MessageVersion.Default;
XmlDictionaryReaderQuotas quotas = be.ReaderQuotas;

CustomBinding binding = new CustomBinding();
BindingParameterCollection bpCol = new BindingParameterCollection();
BindingContext context = new BindingContext(binding, bpCol);
be.BuildChannelFactory<IDuplexChannel>(context);

CustomBinding binding2 = new CustomBinding();
BindingParameterCollection bpCol2 = new BindingParameterCollection();
BindingContext context2 = new BindingContext(binding2, bpCol2);
be.BuildChannelListener<IDuplexChannel>(context2);

be.CanBuildChannelListener<IDuplexChannel>(context2);
BindingElement bindingElement = be.Clone();
MessageEncoderFactory mef = be.CreateMessageEncoderFactory();
MessageVersion mv = be.GetProperty<MessageVersion>(context);

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0

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

Return to top
Show: