OnTryCreateException Method
Collapse the table of content
Expand the table of content

FaultConverter.OnTryCreateException Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

'Declaration
Protected MustOverride Function OnTryCreateException ( _
	message As Message, _
	fault As MessageFault, _
	<OutAttribute> ByRef exception As Exception _
) As Boolean

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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft