OperationCollection::Add Method (Operation^)

 

Adds the specified Operation to the end of the OperationCollection.

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

public:
int Add(
	Operation^ operation
)

Parameters

operation
Type: System.Web.Services.Description::Operation^

The Operation to add to the collection.

Return Value

Type: System::Int32

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

The following example demonstrates the use of the Add method.

OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations;
Operation^ myOperation = gcnew Operation;
myOperation->Name = "Add";
OperationMessage^ myOperationMessageInput = (OperationMessage^)(gcnew OperationInput);
myOperationMessageInput->Message = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace );
OperationMessage^ myOperationMessageOutput = (OperationMessage^)(gcnew OperationOutput);
myOperationMessageOutput->Message = gcnew XmlQualifiedName( "AddSoapOut",myDescription->TargetNamespace );
myOperation->Messages->Add( myOperationMessageInput );
myOperation->Messages->Add( myOperationMessageOutput );
myOperationCollection->Add( myOperation );

.NET Framework
Available since 1.1
Return to top
Show: