TextMessageEncodingBindingElement 類別

定義

繫結項目,可指定用於 SOAP 文字訊息的字元編碼方式和訊息版本控制。The binding element that specifies the character encoding and message versioning used for text-based SOAP messages.

public ref class TextMessageEncodingBindingElement sealed : System::ServiceModel::Channels::MessageEncodingBindingElement, System::ServiceModel::Description::IPolicyExportExtension, System::ServiceModel::Description::IWsdlExportExtension
public sealed class TextMessageEncodingBindingElement : System.ServiceModel.Channels.MessageEncodingBindingElement, System.ServiceModel.Description.IPolicyExportExtension, System.ServiceModel.Description.IWsdlExportExtension
type TextMessageEncodingBindingElement = class
    inherit MessageEncodingBindingElement
    interface IWsdlExportExtension
    interface IPolicyExportExtension
Public NotInheritable Class TextMessageEncodingBindingElement
Inherits MessageEncodingBindingElement
Implements IPolicyExportExtension, IWsdlExportExtension
繼承
TextMessageEncodingBindingElement
實作

備註

編碼是將訊息轉換成位元組序列的處理序,Encoding is the process of transforming a message into a sequence of bytes. 解碼則是相反的處理序。Decoding is the reverse process. Windows Communication Foundation (WCF) 包含 SOAP 訊息的三種編碼類型:文字、二進位和訊息傳輸最佳化機制 (MTOM)。Windows Communication Foundation (WCF) includes three types of encoding for SOAP messages: Text, Binary and Message Transmission Optimization Mechanism (MTOM).

TextMessageEncodingBindingElement 所代表的文字編碼為最具互通性,但針對 XML 訊息編碼器的效率最為不彰。The text encoding represented by the TextMessageEncodingBindingElement is the most interoperable, but the least efficient encoder for XML messages. Web 服務或 Web 服務用戶端通常可以了解文字 XML。Web service or Web service client can generally understand textual XML. 不過,將大型二進位資料區塊當做文字來傳輸是沒有效率的。However, transmitting large blocks of binary data as text is not efficient.

如需有關指定訊息之繫結項目的詳細資訊,請參閱 XML 的 .NET 二進位格式編碼,BinaryMessageEncodingBindingElementFor more information about the binding element that specifies messages are encoded using the .NET Binary Format for XML, see BinaryMessageEncodingBindingElement.

如需有關使用 MTOM 訊息編碼來編碼指定訊息之繫結項目的詳細資訊,請參閱 MtomMessageEncodingBindingElementFor more information about the binding element that specifies messages are encoded using the MTOM message encoding, see MtomMessageEncodingBindingElement.

如需如何執行自訂訊息編碼器的詳細資訊,請使用 MessageEncodingBindingElement 類別。For more information about how to implement a custom message encoder, use the MessageEncodingBindingElement class.

建構函式

TextMessageEncodingBindingElement()

初始化 TextMessageEncodingBindingElement 類別的新執行個體。Initializes a new instance of the TextMessageEncodingBindingElement class.

TextMessageEncodingBindingElement(MessageVersion, Encoding)

使用指定的訊息版本和編碼,初始化 TextMessageEncodingBindingElement 類別的新執行個體。Initializes a new instance of the TextMessageEncodingBindingElement class with a specified message version and encoding.

屬性

MaxReadPoolSize

取得或設定寫入器的數目,這些是配置於集區、準備用來處理傳入訊息的寫入器。Gets or sets the number of readers that are allocated to a pool and ready for use to process incoming messages.

MaxWritePoolSize

取得或設定寫入器的數目,這些是配置於集區、準備用來處理傳出訊息的寫入器。Gets or sets the number of writers that are allocated to a pool and ready for use to process outgoing messages.

MessageVersion

取得或設定用於格式化文字訊息的 SOAP 和 WS-Addressing 版本。Gets or sets the SOAP and WS-Addressing versions that are used to format the text message.

ReaderQuotas

取得或設定 SOAP 訊息複雜性的條件約束,而這些條件約束可由以此繫結所設定的端點處理。Gets or sets constraints on the complexity of SOAP messages that can be processed by endpoints configured with this binding.

WriteEncoding

取得或設定用於格式化文字訊息字元的編碼。Gets or sets the encoding that is used to format the characters in the text message.

方法

BuildChannelFactory<TChannel>(BindingContext)

在用戶端上建置通道處理站堆疊,這個堆疊會針對指定的內容建立指定的通道類型。Builds the channel factory stack on the client that creates a specified type of channel for a specified context.

BuildChannelListener<TChannel>(BindingContext)

在服務上建置通道接聽程式,針對指定的內容,接受指定的通道型別。Builds the channel listener on the service that accepts a specified type of channel for a specified context.

CanBuildChannelFactory<TChannel>(BindingContext)

傳回值,指出繫結項目是否可以建置 (Build) 特定通道類型的通道處理站。Returns a value that indicates whether the binding element can build a channel factory for a specific type of channel.

(繼承來源 BindingElement)
CanBuildChannelListener<TChannel>(BindingContext)

傳回值,這個值會指出目前的繫結是否可以建置指定之通道及內容類型的接聽程式。Returns a value that indicates whether the current binding can build a listener for a specified type of channel and context.

Clone()

新建一個從目前 TextMessageEncodingBindingElement 物件初始化的這類物件。Creates a new TextMessageEncodingBindingElement object initialized from the current one.

CreateMessageEncoderFactory()

建立文字訊息編碼器處理站,這個處理站會採用目前編碼繫結項目所指定的訊息版本與字元編碼。Creates a factory for text message encoders that employs the message version and character encoding specified by the current encoding binding element.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetProperty<T>(BindingContext)

從繫結項目堆疊的適當層次中,傳回要求的型別物件 (如果有的話)。Returns a typed object requested, if present, from the appropriate layer in the binding element stack.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ShouldSerializeReaderQuotas()

傳回是否應序列化針對 SOAP 訊息結構複雜度所設立的約束條件。Returns whether the constraints placed on the complexity of SOAP message structure should be serialized.

ShouldSerializeWriteEncoding()

傳回是否應序列化用於格式化訊息字元的 EncodingReturns whether the Encoding that is used to format the message characters should be serialized.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext)

從繫結項目中包含的編碼原則產生 WSDL 合約資訊。Generates WSDL contract information from encoding policies contained in the binding element.

IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext)

從繫結項目中包含的編碼原則產生 WSDL 合約資訊。Generates WSDL contract information from encoding policies contained in the binding element.

IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext)

從繫結項目中包含的編碼原則產生 WSDL 合約資訊。Generates WSDL contract information from encoding policies contained in the binding element.

適用於