OperationCollection.Add(Operation) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Aggiunge l'oggetto Operation specificato alla fine di OperationCollection.
public:
int Add(System::Web::Services::Description::Operation ^ operation);
public int Add (System.Web.Services.Description.Operation operation);
member this.Add : System.Web.Services.Description.Operation -> int
Public Function Add (operation As Operation) As Integer
Parametri
Restituisce
Indice in base zero in cui è stato aggiunto il parametro operation
.
Esempio
Nell'esempio seguente viene illustrato l'uso del metodo Add
.
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 );
OperationCollection myOperationCollection =
myPortTypeCollection[0].Operations;
Operation myOperation = new Operation();
myOperation.Name = "Add";
OperationMessage myOperationMessageInput =
(OperationMessage) new OperationInput();
myOperationMessageInput.Message = new XmlQualifiedName
("AddSoapIn",myDescription.TargetNamespace);
OperationMessage myOperationMessageOutput =
(OperationMessage) new OperationOutput();
myOperationMessageOutput.Message = new XmlQualifiedName(
"AddSoapOut",myDescription.TargetNamespace);
myOperation.Messages.Add(myOperationMessageInput);
myOperation.Messages.Add(myOperationMessageOutput);
myOperationCollection.Add(myOperation);
Dim myOperationCollection As OperationCollection = _
myPortTypeCollection(0).Operations
Dim myOperation As New Operation()
myOperation.Name = "Add"
Dim myOperationMessageInput As OperationMessage = _
CType(New OperationInput(), OperationMessage)
myOperationMessageInput.Message = New XmlQualifiedName _
("AddSoapIn", myDescription.TargetNamespace)
Dim myOperationMessageOutput As OperationMessage = _
CType(New OperationOutput(), OperationMessage)
myOperationMessageOutput.Message = New XmlQualifiedName _
("AddSoapOut", myDescription.TargetNamespace)
myOperation.Messages.Add(myOperationMessageInput)
myOperation.Messages.Add(myOperationMessageOutput)
myOperationCollection.Add(myOperation)