Represents an in-memory representation of a SOAP fault that can be passed to CreateMessage to create a message that contains a fault.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
When called in a derived class, initializes a new instance of theclass.
Gets or sets the value of the actor.
Gets the SOAP fault code.
Gets a value that indicates whether thehas a detail object.
Gets a value indicating whether this fault was caused by the failure to understand a SOAP header.
Gets the SOAP node containing information about which SOAP node on a message path cause the fault.
Gets a textual description of a SOAP fault.
|CreateFault(FaultCode, FaultReason, Object)|
|CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer)|
|CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String)|
|CreateFault(FaultCode, FaultReason, Object, XmlObjectSerializer, String, String)|
Returns a new FaultCode and fault reason.object that uses the specified
Returns a new Message and the specified maximum buffer size for the message buffer.object that uses the specified
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Returns the detail object of the message fault.
Returns the detail object that uses the specified XmlObjectSerializer.
Serves as the default hash function. (Inherited from Object.)
Returns an XmlDictionaryReader object that is positioned on the detail object of the .
When called in a derived class, returns an XmlDictionaryReader object that is positioned on the detail object of the .
Invoked prior to writing the detail contents.
When overridden in a non-abstract derived class, writes the contents of the detail element.
Writes the start element using the specified XmlDictionaryWriter and SOAP envelope version.
Returns a string that represents the current object.(Inherited from Object.)
|WasHeaderNotUnderstood(MessageHeaders, String, String)|
Gets a value indicating whether the SOAP message headers were understood.
Writes the message fault that uses the specified XmlDictionaryWriter and SOAP envelope version.
Writes the message fault that uses the specified XmlWriter and SOAP envelope version.
Use theclass any time you need an in-memory SOAP fault that can be modified and used to create a SOAP message that contains the fault information.
Typically, the IErrorHandler interface. In this case, Windows Communication Foundation (WCF) passes the object and you use it for your specific needs (for example, you can customize the or to log fault information). However, can be used anywhere custom SOAP fault message handling is required.class is used when implementing the
The following code example shows the most common use of ProvideFault and HandleError pass in a object that can be modified and returned to the system (in the case of ProvideFault) or used to perform some custom fault-related behavior (in the case of HandleError).. Both the
#Region "IErrorHandler Members" Public Function HandleError(ByVal [error] As Exception) As Boolean Implements IErrorHandler.HandleError Console.WriteLine("HandleError called.") ' Returning true indicates you performed your behavior. Return True End Function ' This is a trivial implementation that converts Exception to FaultException<GreetingFault>. Public Sub ProvideFault(ByVal [error] As Exception, ByVal ver As MessageVersion, ByRef msg As Message) Implements IErrorHandler.ProvideFault Console.WriteLine("ProvideFault called. Converting Exception to GreetingFault....") Dim fe As New FaultException(Of GreetingFault)(New GreetingFault([error].Message)) Dim fault As MessageFault = fe.CreateMessageFault() msg = Message.CreateMessage(ver, fault, "http://microsoft.wcf.documentation/ISampleService/SampleMethodGreetingFaultFault") End Sub #End Region
Available since 8
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.