Redigera

Dela via


OperationFaultCollection.Add(OperationFault) Method

Definition

Adds the specified OperationFault to the end of the OperationFaultCollection.

public:
 int Add(System::Web::Services::Description::OperationFault ^ operationFaultMessage);
public int Add (System.Web.Services.Description.OperationFault operationFaultMessage);
member this.Add : System.Web.Services.Description.OperationFault -> int
Public Function Add (operationFaultMessage As OperationFault) As Integer

Parameters

operationFaultMessage
OperationFault

The OperationFault to add to the collection.

Returns

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

Examples

OperationFaultCollection^ myOperationFaultCollection = myOperation->Faults;
OperationFault^ myOperationFault = gcnew OperationFault;
myOperationFault->Name = "ErrorString";
myOperationFault->Message = gcnew XmlQualifiedName( "s0:GetTradePriceStringFault" );
myOperationFaultCollection->Add( myOperationFault );
OperationFaultCollection myOperationFaultCollection = myOperation.Faults;
OperationFault myOperationFault = new OperationFault();
myOperationFault.Name = "ErrorString";
myOperationFault.Message = new XmlQualifiedName("s0:GetTradePriceStringFault");
myOperationFaultCollection.Add(myOperationFault);
Dim myOperationFaultCollection As OperationFaultCollection = myOperation.Faults
Dim myOperationFault As New OperationFault()
myOperationFault.Name = "ErrorString"
myOperationFault.Message = New XmlQualifiedName("s0:GetTradePriceStringFault")
myOperationFaultCollection.Add(myOperationFault)

Applies to