IClientChannelSink.GetRequestStream Method (IMessage, ITransportHeaders)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the Stream onto which the provided message is to be serialized.

Namespace:   System.Runtime.Remoting.Channels
Assembly:  mscorlib (in mscorlib.dll)

[SecurityCriticalAttribute]
Stream GetRequestStream(
	IMessage msg,
	ITransportHeaders headers
)

Parameters

msg
Type: System.Runtime.Remoting.Messaging.IMessage

The IMethodCallMessage containing details about the method call.

headers
Type: System.Runtime.Remoting.Channels.ITransportHeaders

The headers to add to the outgoing message heading to the server.

Return Value

Type: System.IO.Stream

The Stream onto which the provided message is to be serialized.

Exception Condition
SecurityException

The immediate caller does not have infrastructure permission.

The GetRequestStream method is called by the formatter sink before it serializes the message.

The following code example illustrates an implementation of this method.

[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
public Stream GetRequestStream (IMessage message, ITransportHeaders requestHeaders)
{
    // Get the request stream from the next sink in the chain.
    return( nextSink.GetRequestStream(message, requestHeaders) );
}

SecurityPermission

for operating with infrastructure code. Demand value: SecurityAction.LinkDemand; Permission value: SecurityPermissionFlag.Infrastructure

.NET Framework
Available since 1.1
Return to top
Show: