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 消息的编码类型是文本、JSON 和原始。
WebMessageEncodingElement 可表示配置中的 WebMessageEncodingBindingElement。 WebMessageEncodingBindingElement提供用于插入复合编码器的扩展点,该扩展点可用于替代传入消息内容类型如何映射到各种内部编码器, (文本/JSON/原始二进制) 由 Windows Communication Foundation (WCF) 提供。 复合消息编码器不支持 SOAP 或 WS-Addressing。
构造函数
WebMessageEncodingElement() |
初始化 WebMessageEncodingElement 类的新实例。 |