IReplyChannel.ReceiveRequest Method (System.ServiceModel.Channels)

Switch View :
ScriptFree
.NET Framework Class Library
IReplyChannel.ReceiveRequest Method

Returns the context of the request received, if one is available. If a context is not available, waits until there is one available.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
Syntax

Visual Basic
Function ReceiveRequest As RequestContext
C#
RequestContext ReceiveRequest()
Visual C++
RequestContext^ ReceiveRequest()
F#
abstract ReceiveRequest : unit -> RequestContext 

Return Value

Type: System.ServiceModel.Channels.RequestContext
The RequestContext used to construct replies.
Remarks

RequestContext encapsulates the request message and a mechanism for replying to that message.

ReceiveRequest can be called multiple times or concurrently. Only one ReceiveRequest call completes per request received.

If the request message received is larger that the maximum message size allowed by the binding being used, a QuotaExceededException is thrown. The maximum message size is set by the MaxReceivedMessageSize property. The default value is 65536 bytes.

Examples

The following code illustrates how to implement this method:

C#

public RequestContext ReceiveRequest()
{
    return ReceiveRequest(DefaultReceiveTimeout);
}


Version Information

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference