FaultConverter.OnTryCreateException Method

When implemented in a derived class, tries to create the exception.

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

protected abstract bool OnTryCreateException(
	Message message,
	MessageFault fault,
	out Exception exception
)

Parameters

message
Type: System.ServiceModel.Channels.Message
The fault Message.
fault
Type: System.ServiceModel.Channels.MessageFault
The fault.
exception
Type: System.Exception%
If the conversion is successful, the SOAP Exception returned as an out parameter.

Return Value

Type: System.Boolean
true if fault was successfully converted; otherwise, false. The default is false.

For a channel layer to implement GetProperty<FaultConverter> to support converting fault messages to SOAP exceptions, override this method to create an exception by inspecting the fault message and doing the following:

  • If recognized, do the appropriate conversion.

  • If not recognized, convert it by a call to GetProperty<FaultConverter> on the inner channel.

Transport channels should delegate to GetDefaultFaultConverter to get the default SOAP/WS-Addressing fault converter.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: