Export (0) Print
Expand All

FaultBinding Class

Specifies the format for any error messages that might be output as a result of the operation. This class cannot be inherited.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

public ref class FaultBinding sealed : public MessageBinding
public final class FaultBinding extends MessageBinding
public final class FaultBinding extends MessageBinding
Not applicable.

The FaultBinding class corresponds to the Web Services Description Language (WSDL) <fault> element enclosed by the <operation> element, which in turn corresponds to the OperationBinding class. For more information about WSDL, see the specification at http://www.w3.org/TR/wsdl/.

The following example demonstrates a typical use of the FaultBinding class.

FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults;
FaultBinding^ myFaultBinding = gcnew FaultBinding;
myFaultBinding->Name = "ErrorString";
// Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding->Extensions;
SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding;
mySoapFaultBinding->Use = SoapBindingUse::Literal;
mySoapFaultBinding->Namespace = "http://www.contoso.com/stockquote";
myExtensions->Add( mySoapFaultBinding );
myFaultBindingCollection->Add( myFaultBinding );

FaultBindingCollection myFaultBindingCollection = 
    myOperationBinding.get_Faults();
FaultBinding myFaultBinding = new FaultBinding();
myFaultBinding.set_Name("ErrorString");

// Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding.get_Extensions();
SoapFaultBinding mySoapFaultBinding = new SoapFaultBinding();

mySoapFaultBinding.set_Use(SoapBindingUse.Literal);
mySoapFaultBinding.set_Namespace("http://www.contoso.com/stockquote");
myExtensions.Add(mySoapFaultBinding);
myFaultBindingCollection.Add(myFaultBinding);

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft