FaultConverter.OnTryCreateException(Message, MessageFault, Exception) Método

Definição

Tenta criar a exceção.Tries to create the exception.

protected:
 abstract bool OnTryCreateException(System::ServiceModel::Channels::Message ^ message, System::ServiceModel::Channels::MessageFault ^ fault, [Runtime::InteropServices::Out] Exception ^ % exception);
protected abstract bool OnTryCreateException (System.ServiceModel.Channels.Message message, System.ServiceModel.Channels.MessageFault fault, out Exception exception);
abstract member OnTryCreateException : System.ServiceModel.Channels.Message * System.ServiceModel.Channels.MessageFault * Exception -> bool
Protected MustOverride Function OnTryCreateException (message As Message, fault As MessageFault, ByRef exception As Exception) As Boolean

Parâmetros

message
Message

A mensagem de falha.The fault message.

fault
MessageFault

A falha.The fault.

exception
Exception

Se a conversão for bem-sucedida, a exceção de SOAP será retornada como um parâmetro out.If conversion is successful, the SOAP exception, returned as an out parameter.

Retornos

Boolean

true se a falha foi convertida com êxito; caso contrário, false.true if fault was successfully converted; otherwise, false. O padrão é false.The default is false.

Comentários

Para que uma camada de canal seja implementada GetProperty<FaultConverter> para dar suporte à conversão de mensagens de falha em exceções SOAP, substitua esse método para criar uma exceção executando as seguintes etapas:For a channel layer to implement GetProperty<FaultConverter> to support converting fault messages to SOAP exceptions, override this method to create an exception by doing the following steps:

  • Inspecione a mensagem de falha.Inspect the fault message.

  • Se for reconhecido, faça a conversão apropriada.If recognized, do the appropriate conversion.

  • Se não for reconhecido, converta-o por uma chamada para GetProperty<FaultConverter> no canal interno.If not recognized, convert it by a call to GetProperty<FaultConverter> on the inner channel.

Os canais de transporte devem delegar para GetDefaultFaultConverter obter o conversor de falha padrão SOAP/WS-Addressing.Transport channels should delegate to GetDefaultFaultConverter to get the default SOAP/WS-Addressing fault converter.

Aplica-se a