Message Message Message Message Class

定義

表示分散式環境中端點之間的通訊單位。Represents the unit of communication between endpoints in a distributed environment.

public ref class Message abstract : IDisposable
public abstract class Message : IDisposable
type Message = class
    interface IDisposable
Public MustInherit Class Message
Implements IDisposable
繼承
MessageMessageMessageMessage
實作

範例

下列程式碼範例會示範使用通道處理站傳送訊息和讀取回覆的用戶端。The following code example shows a client that uses the channel factory to send a message and read the reply.

using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Runtime.Serialization;

namespace ConsoleApplication1
{
    class client
    {


        static void RunClient()
        {
            //Step1: create a binding with just HTTP
            CustomBinding binding = new CustomBinding();
            binding.Elements.Add(new HttpTransportBindingElement());
            //Step2: use the binding to build the channel factory
            IChannelFactory<IRequestChannel> factory =
            binding.BuildChannelFactory<IRequestChannel>(
                             new BindingParameterCollection());
            //open the channel factory
            factory.Open();
            //Step3: use the channel factory to create a channel
            IRequestChannel channel = factory.CreateChannel(
               new EndpointAddress("http://localhost:8080/channelapp"));
            channel.Open();
            //Step4: create a message
            Message requestmessage = Message.CreateMessage(
                MessageVersion.Soap12WSAddressing10,
                "http://contoso.com/someaction",
                 "This is the body data");
            //send message
            Message replymessage = channel.Request(requestmessage);
            Console.WriteLine("Reply message received");
            Console.WriteLine("Reply action: {0}",
                                  replymessage.Headers.Action);
            string data = replymessage.GetBody<string>();
            Console.WriteLine("Reply content: {0}", data);
            //Step5: don't forget to close the message
            requestmessage.Close();
            replymessage.Close();
            //don't forget to close the channel
            channel.Close();
            //don't forget to close the factory
            factory.Close();
        }
        public static void Main()
        {
            Console.WriteLine("Press [ENTER] when service is ready");
            Console.ReadLine();
            RunClient();
            Console.WriteLine("Press [ENTER] to exit");
            Console.ReadLine();
        }
    }
}


Imports System.Collections.Generic
Imports System.Text
Imports System.ServiceModel
Imports System.ServiceModel.Channels
Imports System.Runtime.Serialization

Namespace ConsoleApplication1
    Friend Class client


        Private Shared Sub RunClient()
            'Step1: create a binding with just HTTP
            Dim binding As New CustomBinding()
            binding.Elements.Add(New HttpTransportBindingElement())
            'Step2: use the binding to build the channel factory
            Dim factory As IChannelFactory(Of IRequestChannel) = binding.BuildChannelFactory(Of IRequestChannel)(New BindingParameterCollection())
            'open the channel factory
            factory.Open()
            'Step3: use the channel factory to create a channel
            Dim channel As IRequestChannel = factory.CreateChannel(New EndpointAddress("http://localhost:8080/channelapp"))
            channel.Open()
            'Step4: create a message
            Dim requestmessage As Message = Message.CreateMessage(MessageVersion.Soap12WSAddressing10, "http://contoso.com/someaction", "This is the body data")
            'send message
            Dim replymessage As Message = channel.Request(requestmessage)
            Console.WriteLine("Reply message received")
            Console.WriteLine("Reply action: {0}", replymessage.Headers.Action)
            Dim data = replymessage.GetBody(Of String)()
            Console.WriteLine("Reply content: {0}", data)
            'Step5: don't forget to close the message
            requestmessage.Close()
            replymessage.Close()
            'don't forget to close the channel
            channel.Close()
            'don't forget to close the factory
            factory.Close()
        End Sub
        Public Shared Sub Main()
            Console.WriteLine("Press [ENTER] when service is ready")
            Console.ReadLine()
            RunClient()
            Console.WriteLine("Press [ENTER] to exit")
            Console.ReadLine()
        End Sub
    End Class
End Namespace

備註

Message 類別提供在網路上傳送者和接收者之間進行任意資訊通訊的方法。The Message class provides a means of communicating arbitrary information between a sender and a receiver on a network. 它可以用於轉送資訊、建議或要求動作或要求資料。It can be used to relay information, suggest or demand a course of action, or request data.

Message 物件的結構表示 SOAP 封套。The structure of a Message object represents a SOAP envelope. 它是由兩個不同的部分組成的:訊息的本文和標頭的選擇性集合,由 Headers 類別表示。It consists of two distinct parts: the message's body and an optional collection of headers, represented by the Headers class. 訊息內容是從傳送者傳送到接收者的應用程式定義資料。The message content is application-defined data sent from a sender to a receiver. 訊息標頭可讓系統和應用程式擴充性符合多變的需求,因為您可以將程式碼定義成操作及回應特定的標頭。The message headers enable system and application extensibility to meet the changing requirements, because you can define code to manipulate and respond to specific headers. 您還可以定義自己的標頭。You can also define your own headers. 訊息標頭會和訊息的內容一起序列化或還原序列化。Message headers are serialized or deserialized along with the contents of the message.

訊息會使用特定的格式進行接收及傳送。Messages are received and sent in particular formats. 提供兩種格式的支援:以標準文字為基礎的 XML 格式和以二進位為基礎的 XML 格式。Support is provided for two formats: the standard text-based XML format and a binary-based XML format. Message 物件可以用來表示 SOAP 1.1 和 SOAP 1.2 封套。The Message object can be used to represent both SOAP 1.1 and SOAP 1.2 envelopes. 請注意,Message 的執行個體會在建立時固定,並且繫結至特定的 SOAP 版本。Note that an instance of Message is fixed upon creation and is bound to a specific SOAP version. Version 屬性表示訊息的 SOAP 版本。The Version property represents the SOAP version of the message.

Message 物件可以使用 WriteMessage 方法序列化到外部存放區。A Message object can be serialized to an external store by using the WriteMessage method. 雖然訊息的屬性也可以序列化,但是必須個別進行識別和序列化。Properties of the message can also be serialized, but they have to be individually identified and serialized separately. 使用 Message,即可還原序列化訊息以建立記憶體中 CreateMessage 物件。Deserializing a message to create an in-memory Message object can be done using CreateMessage. 屬性也必須個別進行還原序列化,並手動新增至特定 Message 執行個體的屬性集合。Properties must also be deserialized individually and manually added to the property collection for the specific Message instance.

Message 物件的大小是由所傳輸的資料大小決定。The size of a Message object is fixed to the size of data it is transmitting. 每個本文都會模型化成 XmlReader 的執行個體,而且對於 XmlReader 執行個體正在包裝的資料流大小沒有預先定義的限制。Every body is modeled as an instance of XmlReader, with no predefined limit on the size of the stream that the XmlReader instance is wrapping. 然而,特定的通道提供者可以對所處理的訊息大小設定限制。However, specific channel providers can have a limit on the size of messages that they process.

Message 可加上由已檢查並處理訊息的實體所產生之有用資訊的註解。A Message can be annotated with useful information generated by an entity that has examined and processed the message. 這個功能是由 HeadersProperties 屬性提供。This functionality is provided by the Headers and Properties properties. Headers 集合表示訊息上的一組 SOAP 標頭。The Headers collection represents the set of SOAP headers on the message.

Properties 屬性表示訊息上的一組處理等級附註。The Properties property represents the set of processing-level annotations on the message. 由於標頭中的資訊會在網路上傳輸,因此檢查標頭的實體必須支援該標頭所使用通訊協定的基礎版本。Because information in headers is transmitted on the wire, an entity that examines a header must support the underlying version(s) of the protocols used by the header. 然而,屬性會提供與版本更加無關的方法來註解訊息。However, properties provide a more version-independent way of annotating a message.

如果要建立 Message 執行個體,請使用其中一種 CreateMessage 方法。To create a Message instance, use one of the CreateMessage methods.

建議訊息消費者在完成存取訊息的內容時,一定要呼叫 CloseIt is recommended that a consumer of a message always call Close when the consumer is finished accessing the contents of the message. 這個動作會釋放與訊息存留期有密切關係的有限系統資源 (例如通訊端、具名管道)。This action frees finite system resources (for example, sockets, named pipes) that are tied to the lifetime of the message.

給衍生自此類別之 Managed C++ 使用者的特別說明:Special note for Managed C++ users deriving from this class:

  • 請將您的清除程式碼置於 (On)(Begin)Close (and/or OnAbort),而不是解構函式。Put your cleanup code in (On)(Begin)Close (and/or OnAbort), not in a destructor.

  • 避免使用解構函式,因為它們會導致編譯器自動產生 IDisposableAvoid destructors: they cause the compiler to auto-generate IDisposable.

  • 避免使用非參考成員,因為它們會導致編譯器自動產生 IDisposableAvoid non-reference members: they can cause the compiler to auto-generate IDisposable.

  • 避免使用完成項,但如果您要加入完成項,請隱藏建置警告並從 (On)(Begin)Close (和/或 OnAbort) 呼叫 SuppressFinalize(Object) 和完成項本身,以模擬原本可能自動產生的 IDisposable 行為。Avoid finalizers; but if you include one, suppress the build warning and call SuppressFinalize(Object) and the finalizer itself from (On)(Begin)Close (and/or OnAbort) to emulate what would have been the auto-generated IDisposable behavior.

給繼承者的注意事項

當您繼承自 Message 時,您必須覆寫下列成員:HeadersVersionWhen you inherit from Message, you must override the following members: Headers, and Version.

建構函式

Message() Message() Message() Message()

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

屬性

Headers Headers Headers Headers

在衍生類別中覆寫時,會取得訊息的標頭。When overridden in a derived class, gets the headers of the message.

IsDisposed IsDisposed IsDisposed IsDisposed

傳回值,指出是否已處置 MessageReturns a value that indicates whether the Message is disposed.

IsEmpty IsEmpty IsEmpty IsEmpty

傳回值,這個值表示 Message 是否為空白。Returns a value that indicates whether the Message is empty.

IsFault IsFault IsFault IsFault

取得值,這個值表示這個訊息是否會產生任何的 SOAP 錯誤。Gets a value that indicates whether this message generates any SOAP faults.

Properties Properties Properties Properties

在衍生類別中覆寫時,會取得一組訊息的處理層級附註。When overridden in a derived class, gets a set of processing-level annotations to the message.

State State State State

取得這個 Message 的目前狀態。Gets the current state of this Message.

Version Version Version Version

在衍生類別中覆寫時,會取得訊息的 SOAP 版本。When overridden in a derived class, gets the SOAP version of the message.

方法

BeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object) BeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object) BeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object) BeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object)

開始非同步寫入訊息本文的內容。Starts the asynchronous writing of the contents of the message body.

BeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object) BeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object) BeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object) BeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object)

開始非同步寫入整個訊息。Starts the asynchronous writing of the entire message.

Close() Close() Close() Close()

關閉 Message 並釋放所有資源。Closes the Message and releases any resources.

CreateBufferedCopy(Int32) CreateBufferedCopy(Int32) CreateBufferedCopy(Int32) CreateBufferedCopy(Int32)

將整個 Message 儲存到記憶體緩衝區中,以供未來存取。Stores an entire Message into a memory buffer for future access.

CreateMessage(MessageVersion, FaultCode, String, Object, String) CreateMessage(MessageVersion, FaultCode, String, Object, String) CreateMessage(MessageVersion, FaultCode, String, Object, String) CreateMessage(MessageVersion, FaultCode, String, Object, String)

建立包含 SOAP 錯誤、錯誤的原因和詳細資料、版本和動作的訊息。Creates a message that contains a SOAP fault, a reason and the detail for the fault, a version and an action.

CreateMessage(MessageVersion, FaultCode, String, String) CreateMessage(MessageVersion, FaultCode, String, String) CreateMessage(MessageVersion, FaultCode, String, String) CreateMessage(MessageVersion, FaultCode, String, String)

建立包含 SOAP 錯誤、錯誤的原因、版本和動作的訊息。Creates a message that contains a SOAP fault, the reason for the fault, a version and an action.

CreateMessage(MessageVersion, MessageFault, String) CreateMessage(MessageVersion, MessageFault, String) CreateMessage(MessageVersion, MessageFault, String) CreateMessage(MessageVersion, MessageFault, String)

建立包含 SOAP 錯誤、版本和動作的訊息。Creates a message that contains a SOAP fault, a version and an action.

CreateMessage(MessageVersion, String) CreateMessage(MessageVersion, String) CreateMessage(MessageVersion, String) CreateMessage(MessageVersion, String)

建立包含版本和動作的訊息。Creates a message that contains a version and an action.

CreateMessage(MessageVersion, String, BodyWriter) CreateMessage(MessageVersion, String, BodyWriter) CreateMessage(MessageVersion, String, BodyWriter) CreateMessage(MessageVersion, String, BodyWriter)

使用由位元組陣列組成的本文來建立訊息。Creates a message with a body that consists of an array of bytes.

CreateMessage(MessageVersion, String, Object) CreateMessage(MessageVersion, String, Object) CreateMessage(MessageVersion, String, Object) CreateMessage(MessageVersion, String, Object)

使用指定的版本、動作和本文建立訊息。Creates a message with the specified version, action and body.

CreateMessage(MessageVersion, String, Object, XmlObjectSerializer) CreateMessage(MessageVersion, String, Object, XmlObjectSerializer) CreateMessage(MessageVersion, String, Object, XmlObjectSerializer) CreateMessage(MessageVersion, String, Object, XmlObjectSerializer)

使用指定的版本、動作、訊息本文和序列化程式建立訊息。Creates a message using the specified version, action, message body and serializer.

CreateMessage(MessageVersion, String, XmlDictionaryReader) CreateMessage(MessageVersion, String, XmlDictionaryReader) CreateMessage(MessageVersion, String, XmlDictionaryReader) CreateMessage(MessageVersion, String, XmlDictionaryReader)

使用指定的版本、動作和本文建立訊息。Creates a message with the specified version, action and body.

CreateMessage(MessageVersion, String, XmlReader) CreateMessage(MessageVersion, String, XmlReader) CreateMessage(MessageVersion, String, XmlReader) CreateMessage(MessageVersion, String, XmlReader)

使用指定的讀取器、動作和版本建立訊息。Creates a message using the specified reader, action and version.

CreateMessage(XmlDictionaryReader, Int32, MessageVersion) CreateMessage(XmlDictionaryReader, Int32, MessageVersion) CreateMessage(XmlDictionaryReader, Int32, MessageVersion) CreateMessage(XmlDictionaryReader, Int32, MessageVersion)

使用指定的讀取器、動作和版本建立訊息。Creates a message using the specified reader, action and version.

CreateMessage(XmlReader, Int32, MessageVersion) CreateMessage(XmlReader, Int32, MessageVersion) CreateMessage(XmlReader, Int32, MessageVersion) CreateMessage(XmlReader, Int32, MessageVersion)

使用指定的讀取器、動作和版本建立訊息。Creates a message using the specified reader, action and version.

EndWriteBodyContents(IAsyncResult) EndWriteBodyContents(IAsyncResult) EndWriteBodyContents(IAsyncResult) EndWriteBodyContents(IAsyncResult)

結束非同步寫入訊息主體的內容。Ends the asynchronous writing of the contents of the message body.

EndWriteMessage(IAsyncResult) EndWriteMessage(IAsyncResult) EndWriteMessage(IAsyncResult) EndWriteMessage(IAsyncResult)

結束非同步寫入整個訊息。Ends the asynchronous writing of the entire message.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetBody<T>() GetBody<T>() GetBody<T>() GetBody<T>()

擷取這個 Message 執行個體的本文。Retrieves the body of this Message instance.

GetBody<T>(XmlObjectSerializer) GetBody<T>(XmlObjectSerializer) GetBody<T>(XmlObjectSerializer) GetBody<T>(XmlObjectSerializer)

使用指定的序列化程式來擷取這個 Message 的本文。Retrieves the body of this Message using the specified serializer.

GetBodyAttribute(String, String) GetBodyAttribute(String, String) GetBodyAttribute(String, String) GetBodyAttribute(String, String)

擷取訊息本文的屬性。Retrieves the attributes of the message body.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetReaderAtBodyContents() GetReaderAtBodyContents() GetReaderAtBodyContents() GetReaderAtBodyContents()

取得會存取此訊息之本文內容的 XML 字典讀取器。Gets the XML dictionary reader that accesses the body content of this message.

GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnBeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object) OnBeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object) OnBeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object) OnBeginWriteBodyContents(XmlDictionaryWriter, AsyncCallback, Object)

訊息開始寫入訊息內容時引發事件。Raises an event when the message starts writing the contents of the message body.

OnBeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object) OnBeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object) OnBeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object) OnBeginWriteMessage(XmlDictionaryWriter, AsyncCallback, Object)

引發開始撰寫整封郵件的事件。Raises an event the writing of entire messages starts.

OnBodyToString(XmlDictionaryWriter) OnBodyToString(XmlDictionaryWriter) OnBodyToString(XmlDictionaryWriter) OnBodyToString(XmlDictionaryWriter)

在訊息本文轉換成字串時呼叫。Called when the message body is converted to a string.

OnClose() OnClose() OnClose() OnClose()

在訊息關閉時呼叫。Called when the message is closing.

OnCreateBufferedCopy(Int32) OnCreateBufferedCopy(Int32) OnCreateBufferedCopy(Int32) OnCreateBufferedCopy(Int32)

在建立訊息緩衝區以儲存此訊息時呼叫。Called when a message buffer is created to store this message.

OnEndWriteBodyContents(IAsyncResult) OnEndWriteBodyContents(IAsyncResult) OnEndWriteBodyContents(IAsyncResult) OnEndWriteBodyContents(IAsyncResult)

完成寫入郵件本文內容時引發事件。Raises an event when writing of the contents of the message body ends.

OnEndWriteMessage(IAsyncResult) OnEndWriteMessage(IAsyncResult) OnEndWriteMessage(IAsyncResult) OnEndWriteMessage(IAsyncResult)

完成寫入整封郵件時引發事件。Raises an event when the writing of the entire message ends.

OnGetBody<T>(XmlDictionaryReader) OnGetBody<T>(XmlDictionaryReader) OnGetBody<T>(XmlDictionaryReader) OnGetBody<T>(XmlDictionaryReader)

在擷取訊息本文時呼叫。Called when the body of the message is retrieved.

OnGetBodyAttribute(String, String) OnGetBodyAttribute(String, String) OnGetBodyAttribute(String, String) OnGetBodyAttribute(String, String)

在擷取訊息本文的屬性時呼叫。Called when the attributes of the message body is retrieved.

OnGetReaderAtBodyContents() OnGetReaderAtBodyContents() OnGetReaderAtBodyContents() OnGetReaderAtBodyContents()

在擷取存取此訊息之本文內容的 XML 字典讀取器時呼叫。Called when an XML dictionary reader that accesses the body content of this message is retrieved.

OnWriteBodyContents(XmlDictionaryWriter) OnWriteBodyContents(XmlDictionaryWriter) OnWriteBodyContents(XmlDictionaryWriter) OnWriteBodyContents(XmlDictionaryWriter)

在訊息本文寫入至 XML 檔案時呼叫。Called when the message body is written to an XML file.

OnWriteMessage(XmlDictionaryWriter) OnWriteMessage(XmlDictionaryWriter) OnWriteMessage(XmlDictionaryWriter) OnWriteMessage(XmlDictionaryWriter)

在整個訊息寫入至 XML 檔案時呼叫。Called when the entire message is written to an XML file.

OnWriteStartBody(XmlDictionaryWriter) OnWriteStartBody(XmlDictionaryWriter) OnWriteStartBody(XmlDictionaryWriter) OnWriteStartBody(XmlDictionaryWriter)

在開始本文寫入至 XML 檔案時呼叫。Called when the start body is written to an XML file.

OnWriteStartEnvelope(XmlDictionaryWriter) OnWriteStartEnvelope(XmlDictionaryWriter) OnWriteStartEnvelope(XmlDictionaryWriter) OnWriteStartEnvelope(XmlDictionaryWriter)

在開始封套寫入至 XML 檔案時呼叫。Called when the start envelope is written to an XML file.

OnWriteStartHeaders(XmlDictionaryWriter) OnWriteStartHeaders(XmlDictionaryWriter) OnWriteStartHeaders(XmlDictionaryWriter) OnWriteStartHeaders(XmlDictionaryWriter)

在開始標頭寫入至 XML 檔案時呼叫。Called when the start header is written to an XML file.

ToString() ToString() ToString() ToString()

傳回表示目前 Message 執行個體的字串。Returns a string that represents the current Message instance.

WriteBody(XmlDictionaryWriter) WriteBody(XmlDictionaryWriter) WriteBody(XmlDictionaryWriter) WriteBody(XmlDictionaryWriter)

使用指定的 XmlDictionaryWriter 寫入本文項目。Writes the body element using the specified XmlDictionaryWriter.

WriteBody(XmlWriter) WriteBody(XmlWriter) WriteBody(XmlWriter) WriteBody(XmlWriter)

使用指定的 XmlWriter 序列化訊息本文。Serializes the message body using the specified XmlWriter.

WriteBodyContents(XmlDictionaryWriter) WriteBodyContents(XmlDictionaryWriter) WriteBodyContents(XmlDictionaryWriter) WriteBodyContents(XmlDictionaryWriter)

使用指定的 XmlDictionaryWriter 序列化本文內容。Serializes the body content using the specified XmlDictionaryWriter.

WriteMessage(XmlDictionaryWriter) WriteMessage(XmlDictionaryWriter) WriteMessage(XmlDictionaryWriter) WriteMessage(XmlDictionaryWriter)

使用指定的 XmlDictionaryWriter 序列化整個訊息。Serializes the entire message using the specified XmlDictionaryWriter.

WriteMessage(XmlWriter) WriteMessage(XmlWriter) WriteMessage(XmlWriter) WriteMessage(XmlWriter)

使用指定的 XmlWriter 序列化整個訊息。Serializes the entire message using the specified XmlWriter.

WriteStartBody(XmlDictionaryWriter) WriteStartBody(XmlDictionaryWriter) WriteStartBody(XmlDictionaryWriter) WriteStartBody(XmlDictionaryWriter)

使用指定的 XmlDictionaryWriter 序列化訊息的開始本文。Serializes the start body of the message using the specified XmlDictionaryWriter.

WriteStartBody(XmlWriter) WriteStartBody(XmlWriter) WriteStartBody(XmlWriter) WriteStartBody(XmlWriter)

使用指定的 XmlDictionaryWriter 序列化訊息的開始本文。Serializes the start body of the message using the specified XmlDictionaryWriter.

WriteStartEnvelope(XmlDictionaryWriter) WriteStartEnvelope(XmlDictionaryWriter) WriteStartEnvelope(XmlDictionaryWriter) WriteStartEnvelope(XmlDictionaryWriter)

使用指定的 XmlDictionaryWriter 序列化開始封套。Serializes the start envelope using the specified XmlDictionaryWriter.

明確介面實作

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

關閉此訊息使用的所有資源。Closes all the resources used by this message. 這個方法無法被繼承。This method cannot be inherited.

擴充方法

ToHttpRequestMessage(Message) ToHttpRequestMessage(Message) ToHttpRequestMessage(Message) ToHttpRequestMessage(Message)

HttpRequestMessage 執行個體建立 Message 執行個體。Creates a HttpRequestMessage instance from an Message instance.

ToHttpResponseMessage(Message) ToHttpResponseMessage(Message) ToHttpResponseMessage(Message) ToHttpResponseMessage(Message)

HttpResponseMessage 執行個體建立 Message 執行個體。Creates a HttpResponseMessage instance from an Message instance.

適用於