FaultBindingCollection::Add Method (FaultBinding^)

 

Adds the specified FaultBinding to the end of the FaultBindingCollection.

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

public:
int Add(
	FaultBinding^ bindingOperationFault
)

Parameters

bindingOperationFault
Type: System.Web.Services.Description::FaultBinding^

The FaultBinding to add to the collection.

Return Value

Type: System::Int32

The zero-based index where the bindingOperationFault parameter has been added.

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 );

.NET Framework
Available since 1.1
Return to top
Show: