FaultConverter.TryCreateFaultMessage Method (Exception, Message)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Wraps OnTryCreateFaultMessage with error checking.

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

public bool TryCreateFaultMessage(
	Exception exception,
	out Message message
)

Parameters

exception
Type: System.Exception

The SOAP exception.

message
Type: System.ServiceModel.Channels.Message

The fault message returned as an out parameter.

Return Value

Type: System.Boolean

true if fault message was successfully created; otherwise, false. The default is false.

Exception Condition
ArgumentNullException

OnTryCreateException returned true but message is null.

ArgumentNullException

OnTryCreateException returned false but message is not null.

OnTryCreateFaultMessage is an abstract class that you must implement. The current method wraps several error tests around a call to that method.

.NET Framework
Available since 3.0
Return to top
Show: