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