TextMessageEncodingBindingElement.WriteEncoding Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the encoding that is used to format the characters in the text message.

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

public Encoding WriteEncoding { get; set; }

Property Value

Type: System.Text.Encoding

The Encoding that is used to format the characters in the text message. The default text encoding is the UTF-8 format.

Exception Condition
ArgumentNullException

The value is null.

ArgumentException

writeEncoding value is not valid.

When specifying a content type such as “utf-16” an XML declaration is required in the message. Alternatively you can specify either “utf-16LE” or “utf-16BE” and an XML declaration is not required.

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