IRequestChannel.Request Método
Definição
Envia uma solicitação baseada em mensagem e retorna a resposta correlacionada com base em mensagem.Sends a message-based request and returns the correlated message-based response.
Sobrecargas
| Request(Message) |
Envia uma solicitação baseada em mensagem e retorna a resposta correlacionada com base em mensagem.Sends a message-based request and returns the correlated message-based response. |
| Request(Message, TimeSpan) |
Envia uma solicitação baseada em mensagem e retorna a resposta correlacionada com base em mensagem dentro de um intervalo de tempo especificado.Sends a message-based request and returns the correlated message-based response within a specified interval of time. |
Request(Message)
Envia uma solicitação baseada em mensagem e retorna a resposta correlacionada com base em mensagem.Sends a message-based request and returns the correlated message-based response.
public:
System::ServiceModel::Channels::Message ^ Request(System::ServiceModel::Channels::Message ^ message);
public System.ServiceModel.Channels.Message Request (System.ServiceModel.Channels.Message message);
abstract member Request : System.ServiceModel.Channels.Message -> System.ServiceModel.Channels.Message
Public Function Request (message As Message) As Message
Parâmetros
Retornos
O Message recebido em resposta à solicitação.The Message received in response to the request.
Exemplos
O código a seguir mostra como implementar esse método:The following code shows how to implement this method:
public Message Request(Message message)
{
return this.InnerChannel.Request(message);
}
Comentários
Implementações de IRequestChannel garantir que a mensagem de resposta esteja correlacionada à mensagem de solicitação.Implementations of IRequestChannel ensure that the response message is correlated with the request message.
Em geral, se uma implementação de IRequestChannel receber uma mensagem que não está correlacionada a uma solicitação pendente, ela será descartada.Generally, if an implementation of IRequestChannel receives a message that is not correlated to an outstanding request, it is dropped.
O Request método pode ser chamado simultaneamente entre vários threads.The Request method can be called concurrently across multiple threads.
Passar a mensagem para o canal de solicitação faz com que a mensagem seja acessada.Passing the message into the request channel causes the message to be accessed. Depois de chamar Request , você não poderá mais inspecionar a mensagem ou chamar Close a mensagem.After you call Request, you can no longer inspect the message or call Close on the message.
Se a mensagem de solicitação for maior que o tamanho máximo de mensagem permitido pela Associação sendo usada, um QuotaExceededException será lançado.If the request message is larger that the maximum message size allowed by the binding being used, a QuotaExceededException is thrown. O tamanho máximo da mensagem é definido pela MaxReceivedMessageSize propriedade.The maximum message size is set by the MaxReceivedMessageSize property. O valor padrão é 65536 bytes.The default value is 65536 bytes.
Aplica-se a
Request(Message, TimeSpan)
Envia uma solicitação baseada em mensagem e retorna a resposta correlacionada com base em mensagem dentro de um intervalo de tempo especificado.Sends a message-based request and returns the correlated message-based response within a specified interval of time.
public:
System::ServiceModel::Channels::Message ^ Request(System::ServiceModel::Channels::Message ^ message, TimeSpan timeout);
public System.ServiceModel.Channels.Message Request (System.ServiceModel.Channels.Message message, TimeSpan timeout);
abstract member Request : System.ServiceModel.Channels.Message * TimeSpan -> System.ServiceModel.Channels.Message
Public Function Request (message As Message, timeout As TimeSpan) As Message
Parâmetros
- timeout
- TimeSpan
O TimeSpan que especifica o intervalo de tempo em que uma resposta deve ser recebida.The TimeSpan that specifies the interval of time within which a response must be received.
Retornos
O Message recebido em resposta à solicitação.The Message received in response to the request.
Exemplos
O código a seguir mostra como implementar esse método.The following code shows how to implement this method.
public Message Request(Message message, TimeSpan timeout)
{
return this.InnerChannel.Request(message, timeout);
}
Comentários
Implementações de IRequestChannel garantir que a mensagem de resposta esteja correlacionada à mensagem de solicitação.Implementations of IRequestChannel ensure that the response message is correlated with the request message.
Em geral, se uma implementação de IRequestChannel receber uma mensagem que não está correlacionada a uma solicitação pendente, ela será descartada.Generally, if an implementation of IRequestChannel receives a message that is not correlated to an outstanding request, it is dropped.
O Request método pode ser chamado simultaneamente entre vários threads.The Request method can be called concurrently across multiple threads.
Passar a mensagem para o canal de solicitação faz com que a mensagem seja acessada.Passing the message into the request channel causes the message to be accessed. Depois de chamar Request , você não poderá mais inspecionar a mensagem ou chamar Close a mensagem.After you call Request, you can no longer inspect the message or call Close on the message.
Se a mensagem de solicitação for maior que o tamanho máximo de mensagem permitido pela Associação sendo usada, um QuotaExceededException será lançado.If the request message is larger that the maximum message size allowed by the binding being used, a QuotaExceededException is thrown. O tamanho máximo da mensagem é definido pela MaxReceivedMessageSize propriedade.The maximum message size is set by the MaxReceivedMessageSize property. O valor padrão é 65536 bytes.The default value is 65536 bytes.
Se um timeout for passado ao chamar a função, esse valor será usado.If a timeout is passed while calling the function then that value is used. Se o SendTimeout for definido na associação, o valor na associação será usado se não timeout for especificado ao chamar a função.If the SendTimeout is set on the binding, then the value on the binding is used if no timeout is specified while calling the function.
O DefaultSendTimeout será usado se nenhum tempo limite for especificado na associação ou ao chamar a função.The DefaultSendTimeout is used if no timeout is specified on either the binding or while calling the function. Esse valor padrão é 1 minuto.This default value is 1 minute.
Notas aos Implementadores
A operação deve lançar um TimeoutException se o especificado timeout for excedido antes da conclusão da operação.The operation should throw a TimeoutException if the specified timeout is exceeded before the operation is completed.