CreateFault Method (MessageFault, String, Type[])
Collapse the table of content
Expand the table of content

FaultException.CreateFault Method (MessageFault, String, Type[])

Returns a FaultException object from the specified message fault, action and an array of detail types.

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

public static FaultException CreateFault(
	MessageFault messageFault,
	string action,
	params Type[] faultDetailTypes


Type: System.ServiceModel.Channels.MessageFault
The message fault that contains default SOAP fault information.
Type: System.String
The fault action value.
Type: System.Type[]
An array of types that contains fault details.

Return Value

Type: System.ServiceModel.FaultException
A FaultException object that you can throw to indicate that a SOAP fault message was received.

The faultDetailTypes parameter contains candidate detail types. If any of the faultDetailTypes has a schema that matches the messageFault parameter, a System.ServiceModel.FaultException<TDetail> is returned where the type parameter is the matching candidate type.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

© 2016 Microsoft