共用方式為


IClientChannelSink.GetRequestStream(IMessage, ITransportHeaders) 方法

定義

傳回所提供訊息將在其上序列化的 Stream

public:
 System::IO::Stream ^ GetRequestStream(System::Runtime::Remoting::Messaging::IMessage ^ msg, System::Runtime::Remoting::Channels::ITransportHeaders ^ headers);
public System.IO.Stream GetRequestStream (System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders headers);
[System.Security.SecurityCritical]
public System.IO.Stream GetRequestStream (System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders headers);
abstract member GetRequestStream : System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders -> System.IO.Stream
[<System.Security.SecurityCritical>]
abstract member GetRequestStream : System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders -> System.IO.Stream
Public Function GetRequestStream (msg As IMessage, headers As ITransportHeaders) As Stream

參數

msg
IMessage

IMethodCallMessage,包含關於方法呼叫的詳細資訊。

headers
ITransportHeaders

要加入至伺服器外送訊息標題的標頭。

傳回

Stream,所提供訊息將在其上序列化。

屬性

例外狀況

立即呼叫端沒有基礎結構使用權限。

範例

下列程式碼範例說明這個方法的實作。

virtual Stream^ GetRequestStream( IMessage^ message, ITransportHeaders^ requestHeaders )
{
   // Get the request stream from the next sink in the chain.
   return (nextSink->GetRequestStream( message, requestHeaders ));
}
public Stream GetRequestStream (IMessage message, ITransportHeaders requestHeaders)
{
    // Get the request stream from the next sink in the chain.
    return( nextSink.GetRequestStream(message, requestHeaders) );
}

備註

方法 GetRequestStream 會在序列化訊息之前,由格式器接收呼叫。

適用於

另請參閱