Assembly: System.ServiceModel.Web (in System.ServiceModel.Web.dll)
Encoding is the process of transforming a message into a sequence of bytes. Decoding is the reverse process. These processes require the specification of a character encoding. The works by delegating to a series of inner encoders to handle the plain-text XML and JSON encodings, and "raw" binary data. This delegation is done by a composite message encoder.
The binding element can be configured with a write character encoding at construction time using the WebMessageEncodingBindingElement(Encoding) constructor. The Encoding value specifies the behavior on write for the JSON and Textual XML cases. On read, any valid message encoding and text encoding is understood.
This constructor sets default values on the maximum number of readers and writers that are allocated to pools and that are respectively available to process incoming and outgoing messages without allocating new readers or writers. The properties MaxReadPoolSize and MaxWritePoolSize can also be used to set the maximum number of readers and writers to be allocated respectively. By default 64 readers and 16 writers are allocated.
Default complexity constraints are also set by this constructor on the XmlDictionaryReaderQuotas associated with this encoding by the ReaderQuotas property to protect against a class of denial of service (DOS) attacks that attempt to use message complexity to tie up endpoint processing resources.
The has a CreateMessageEncoderFactory method that creates a message encoder factory that produces JSON, XML or Raw message decoders and encoders as appropriate depending on the content type specified.
The also provides the methods to build the factories and listeners for the channels through which the HTTP requests flow.
The composite encoder and its associated classes and configuration components are usable in partial trust and this use does not require any special permissions.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.