WebMessageEncodingElement 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示組態項目,指定用於非 SOAP 訊息的字元編碼。 此類別無法獲得繼承。
public ref class WebMessageEncodingElement sealed : System::ServiceModel::Configuration::BindingElementExtensionElement
public sealed class WebMessageEncodingElement : System.ServiceModel.Configuration.BindingElementExtensionElement
type WebMessageEncodingElement = class
inherit BindingElementExtensionElement
Public NotInheritable Class WebMessageEncodingElement
Inherits BindingElementExtensionElement
- 繼承
-
WebMessageEncodingElement
- 繼承
-
WebMessageEncodingElement
範例
using System;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Configuration;
class Program
{
static void Main(string[] args)
{
WebMessageEncodingElement webMEE = new WebMessageEncodingElement();
Console.WriteLine("The BE type is: {0}", webMEE.BindingElementType);
int maxReadPoolSize = webMEE.MaxReadPoolSize;
Console.WriteLine("The MaxReadPoolSize is: {0}", maxReadPoolSize);
maxReadPoolSize = 128;
Console.WriteLine("The MaxReadPoolSize has been changed to: {0}", maxReadPoolSize);
int maxWritePoolSize = webMEE.MaxWritePoolSize;
Console.WriteLine("The MaxWritePoolSize is: {0}", maxWritePoolSize);
maxWritePoolSize = 48;
Console.WriteLine("The MaxWritePoolSize has been changed to: {0}", maxWritePoolSize);
Encoding webMessageEncoding = webMEE.WriteEncoding;
Console.WriteLine("The write encoding is: {0}", webMessageEncoding);
webMessageEncoding = UnicodeEncoding.Unicode;
Console.WriteLine("The write encoding has been changed to: {0}", webMessageEncoding);
XmlDictionaryReaderQuotasElement webMessageReaderQuotasElement = webMEE.ReaderQuotas;
Console.WriteLine("The max depth of the reader Quotas is: {0}", webMessageReaderQuotasElement.MaxDepth);
Console.WriteLine("Press <ENTER> to terminate the program.");
Console.ReadLine();
}
}
備註
編碼是將一組 Unicode 字元轉換成位元組序列的處理程序。 非 SOAP 訊息的編碼類型為 text、JSON 和 raw。
WebMessageEncodingElement 表示組態中的 WebMessageEncodingBindingElement。 WebMessageEncodingBindingElement會提供擴充點,以插入複合編碼器,可用來覆寫內送訊息內容類型如何對應至各種內部編碼器 (text/JSON/raw 二進位) Windows Communication Foundation (WCF) 提供。 複合訊息編碼器不支援 SOAP 或 WS-Addressing。
建構函式
WebMessageEncodingElement() |
初始化 WebMessageEncodingElement 類別的新執行個體。 |