Export (0) Print
Expand All

FaultConverter.OnTryCreateException Method

Tries to create the exception.

Namespace:  System.ServiceModel.Channels
Assemblies:   System.ServiceModel (in System.ServiceModel.dll)
  System.ServiceModel.Primitives (in System.ServiceModel.Primitives.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 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 doing the following steps:

  • Inspect the fault message.

  • 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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft