OperationCollection.Add(Operation) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Agrega el objeto Operation especificado al final de 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
Parámetros
Devoluciones
Índice de base cero en donde se ha agregado el parámetro operation
.
Ejemplos
En el siguiente ejemplo se muestra el uso del método 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)
Se aplica a
Col·laboreu amb nosaltres a GitHub
La font d'aquest contingut es pot trobar al GitHub, on també podeu crear i revisar problemes i sol·licituds d'extracció. Per obtenir més informació, consulteu la nostra guia per a col·laboradors.