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 在序列化消息之前由格式化程序接收器调用。

适用于

另请参阅