MessageVersion 類別


指定與訊息及其交換相關聯的 SOAP 和 WS-Addressing 版本。Specifies the versions of SOAP and WS-Addressing associated with a message and its exchange.

public ref class MessageVersion sealed
public sealed class MessageVersion
type MessageVersion = class
Public NotInheritable Class MessageVersion


MessageVersion,其中包含有關 SOAP 信封和訊息所使用之定址通訊協定的版本控制資訊。The MessageVersion contains the versioning information both about the SOAP envelope and the addressing protocol that is used by a message. Message 的執行個體會在建立時繫結至特定的 MessageVersion,其方式是將版本當做參數傳入其中一個 CreateMessage 多載。An instance of Message is bound upon creation to a specific MessageVersion by passing the version as a parameter into one of the CreateMessage overloads.

此類別中的所有靜態 "get" 屬性 (例如 Soap11WSAddressing10Soap12) 都有類似列舉的語意 (Semantics)。All the static "get" properties in this class, such as Soap11WSAddressing10 and Soap12 have enumeration-like semantics. 它們會提供 Windows Communication Foundation (WCF)執行時間所支援的可能訊息版本的列舉。They provide an enumeration of the possible message versions supported by the Windows Communication Foundation (WCF) runtime. 訊息具有信封結構和定址結構。A message has an envelope structure and an addressing structure. MessageVersion 只是一起提供 {EnvelopeVersion, AddressingVersion} 的捷徑。MessageVersion is just a shortcut for supplying {EnvelopeVersion, AddressingVersion} together.

目前有兩個可用的 SOAP 信封版本:SOAP 1.1 和 SOAP 1.2。There are currently two SOAP envelope versions available: SOAP 1.1 and SOAP 1.2. 這些 SOAP 版本是由 EnvelopeVersion 表示,而且會由 Soap11Soap12 屬性傳回。These versions of SOAP are represented by EnvelopeVersion and are returned by the Soap11 and Soap12 properties. MessageVersion 相關聯的 SOAP 版本可以使用 Envelope 屬性進行復原。The version of SOAP associated with the MessageVersion can be recovered by using the Envelope property. 如需詳細資訊,請參閱soap 1.1soap 1.2的架構。For more information, see the schema for SOAP 1.1 and SOAP 1.2.

目前有兩個 WS-Addressing 版本可用,There are currently two versions of WS-Addressing available. 也就是 2004 年 8 月 10 日提交的版本及 WS-Addressing 1.0 通訊協定中指定的版本。The one submitted on 10 August 2004 and the one specified in the WS-Addressing 1.0 protocol. 目前訊息版本所使用的位址版本可以使用 Addressing 屬性加以修復。The address version used by the current message version can be recovered using the Addressing property. 這些 WS-Addressing 版本是由 AddressingVersion 表示,而且會由 WSAddressingAugust2004WSAddressing10 屬性傳回。These versions of WS-Addressing are represented by AddressingVersion and are returned by the WSAddressingAugust2004 and WSAddressing10 properties. 2004 年 8 月發表的 WS-Addressing 保留為舊版的值。The WS-Addressing August 2004 is retained as a legacy value. 2004年8月10日針對 WS-ADDRESSING 提交的 W3C 成員可在Web 服務定址(ws-addressing)中取得。The 10 August 2004 W3C Member Submission for WS-Addressing is available at Web Services Addressing (WS-Addressing). 2005年8月17日 WS-ADDRESSING 1.0 核心的 W3C 候選建議提供于Web 服務定址 1.0-核心The 17 August 2005 W3C Candidate Recommendation for WS-Addressing 1.0 - Core is available at Web Services Addressing 1.0 - Core.

None 支援使用 "plain old XML" (POX) 樣式的傳訊。None provides support for using "plain old XML" (POX)-style messaging. 啟用基本 POX 傳訊現在與在服務上設定 HTTP 繫結有關,其中包含使用 None 的文字編碼器。Enabling basic POX messaging is now a matter of setting up an HTTP binding on your service with a text encoder that uses None.

可以使用指定版本的 WS-Addressing 和 SOAP (利用其中一個 CreateVersion 多載) 來建立訊息版本物件。Message version objects can be created using specified versions of WS-Addressing and SOAP using one of the CreateVersion overloads.



取得或設定與目前訊息版本相關聯的 WS-Addressing 版本。Gets or sets the version of WS-Addressing that is associated with the current message version.


取得 Windows Communication Foundation (WCF) 所使用的預設訊息版本。Gets the default message version used by Windows Communication Foundation (WCF).


取得與目前訊息版本相關聯的 SOAP 版本。Gets the SOAP version associated with the current message version.


取得未使用 SOAP 或 WS-Addressing 的訊息版本。Gets the message version that does not use SOAP or WS-Addressing.


取得使用 SOAP 1.1 的訊息版本。Gets the message version using SOAP 1.1.


取得使用 WS-Addressing 1.0 和 SOAP 1.1 的訊息版本。Gets the message version using WS-Addressing 1.0 and SOAP 1.1.


使用 2004 年 8 月 10 日提交的 WS-Addressing 和 SOAP 1.1 來取得訊息版本。Gets the message version by using WS-Addressing submitted 10 August 2004 and SOAP 1.1.


取得使用 SOAP 1.2 的訊息版本。Gets the message version using SOAP 1.2.


取得使用 WS-Addressing 1.0 和 SOAP 1.2 的訊息版本。Gets the message version using WS-Addressing 1.0 and SOAP 1.2.


取得使用 2004 年 8 月提交之 WS-Addressing 和 SOAP 1.2 的訊息版本。Gets the message version using WS-Addressing submitted August 2004 and SOAP 1.2.



使用 WS-Addressing 1.0 和指定的 SOAP 版本來建立訊息版本物件。Creates a message version object by using WS-Addressing 1.0 and with a specified SOAP version.

CreateVersion(EnvelopeVersion, AddressingVersion)

使用指定的 SOAP 和 WS-Addressing 版本來建立訊息版本物件。Creates a message version object with specified SOAP and WS-Addressing versions.


傳回值,這個值指出目前的訊息版本是否與指定的物件相等。Returns a value that indicates whether the current message version is equal to a specified object.


取得目前訊息版本的雜湊程式碼。Gets a hash code for the current message version.


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

(繼承來源 Object)

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

(繼承來源 Object)

傳回目前訊息版本的字串表示。Returns the string representation of the current message version.