This topic has not yet been rated Rate this topic

<textMessageEncoding>

Specifies the character encoding and message versioning used for text-based XML messages.


<textMessageEncoding maxReadPoolSize="Integer"
   maxWritePoolSize="Integer"
   messageVersion="Soap11Addressing10/Soap12Addressing10"
      writeEncoding=”UnicodeFffeTextEncoding/Utf16TextEncoding/Utf8TextEncoding" />

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

maxReadPoolSize

An integer that specifies how many messages can be read simultaneously without allocating new readers. Larger pool sizes make the system more tolerant to activity spikes at the cost of a larger working set. The default is 64.

maxWritePoolSize

An integer that specifies how many messages can be sent simultaneously without allocating new writers. Larger pool sizes make the system more tolerant to activity spikes at the cost of a larger working set. The default is 16.

messageVersion

Specifies the SOAP version of the messages sent using the binding. Valid values are

  • Soap11Addressing10

  • Soap12Addressing10

The default is Soap12Addressing10. This attribute is of type MessageVersion.

writeEncoding

Specifies the character set encoding to be used for emitting messages on the binding. Valid values are

  • UnicodeFffeTextEncoding: Unicode BigEndian encoding

  • Utf16TextEncoding: Unicode encoding

  • Utf8TextEncoding: 8-bit encoding

The default is Utf8TextEncoding. This attribute is of type Encoding.

Child Elements

Element Description

<readerQuotas>

Defines the constraints on the complexity of SOAP messages that can be processed by endpoints configured with this binding. This element is of type XmlDictionaryReaderQuotasElement.

Parent Elements

Element Description

<binding>

Defines all binding capabilities of the custom binding.

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 text encoding represented by the textMessageEncoding element is the most interoperable, but the least efficient encoder for XML messages. The text encoder creates text-based messages on the wire. Messages produced by this encoder are suitable for WS-* based interop. Web service or Web service client can generally understand textual XML. However, transmitting large blocks of binary data as text is the least efficient method for encoding XML messages.

<textMessageEncoding maxReadPoolSize="211"
    maxWritePoolSize="2132"
    messageVersion="Soap12Addressing10"
    textEncoding=”utf-8” />
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Encoding values incorrect

The writeEncoding values listed are incorrect. It lists example values like Utf8TextEncoding, then states that the values are of type Encoding, which would seem to imply that the static properties such as UTF8 are the valid values. As it really turns out, the correct value that should be used for Utf8 encoding is 'utf-8'. This seems to conform with the naming table found in the remarks of this page:

http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx

I've had to use alternative encodings in the past as well, such as 'iso-8859-1' (Western European ISO, or Latin-1), and the naming seems to consistently match the "Name" column of the table in the page linked above.