IRequestChannel.EndRequest(IAsyncResult) 方法

定义

完成异步操作以向传送的请求返回基于消息的响应。Completes an asynchronous operation to return a message-based response to a transmitted request.

public:
 System::ServiceModel::Channels::Message ^ EndRequest(IAsyncResult ^ result);
public System.ServiceModel.Channels.Message EndRequest (IAsyncResult result);
abstract member EndRequest : IAsyncResult -> System.ServiceModel.Channels.Message
Public Function EndRequest (result As IAsyncResult) As Message

参数

result
IAsyncResult

通过调用 IAsyncResult 方法返回的 BeginReceiveThe IAsyncResult returned by a call to the BeginReceive method.

返回

Message

在对请求的响应中收到的 MessageThe Message received in response to the request.

示例

下面的代码演示如何实现此方法。The following code shows how to implement this method.

public Message EndRequest(IAsyncResult result)
{
    return this.InnerChannel.EndRequest(result);
}

注解

如果请求消息大于使用的绑定所允许的最大消息大小,则将引发 QuotaExceededExceptionIf the request message is larger that the maximum message size allowed by the binding being used, a QuotaExceededException is thrown. 最大消息大小由 MaxReceivedMessageSize 属性设置。The maximum message size is set by the MaxReceivedMessageSize property. 默认值为 65536 个字节。The default value is 65536 bytes.

适用于