BasicHttpBinding.TextEncoding Property

Gets or sets the character encoding that is used for the message text.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

public Encoding TextEncoding { get; set; }
/** @property */
public Encoding get_TextEncoding ()

/** @property */
public void set_TextEncoding (Encoding value)

public function get TextEncoding () : Encoding

public function set TextEncoding (value : Encoding)

Not applicable.

Property Value

The Encoding that indicates the character encoding that is used. The default is UTF8Encoding.

The following example sets TextEncoding to Text.UnicodeEncoding.

BasicHttpBinding binding = new BasicHttpBinding();
binding.TextEncoding = System.Text.Encoding.Unicode;


The value of this property can also be set in the configuration file.

<configuration>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="Binding1"
          textEncoding = "UnicodeFffeTextEncoding">

          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>

</configuration>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: