OperationMessageCollection.Add-Methode
Fügt die angegebene OperationMessage am Ende der OperationMessageCollection hinzu.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Syntax
'Declaration
Public Function Add ( _
operationMessage As OperationMessage _
) As Integer
'Usage
Dim instance As OperationMessageCollection
Dim operationMessage As OperationMessage
Dim returnValue As Integer
returnValue = instance.Add(operationMessage)
public int Add (
OperationMessage operationMessage
)
public:
int Add (
OperationMessage^ operationMessage
)
public int Add (
OperationMessage operationMessage
)
public function Add (
operationMessage : OperationMessage
) : int
Parameter
- operationMessage
Die der Auflistung hinzuzufügende OperationMessage.
Rückgabewert
Der nullbasierte Index, an dem der operationMessage-Parameter hinzugefügt wurde.
Beispiel
' Get the operation message for the Add operation.
Dim myOperationMessage As OperationMessage = _
myOperationMessageCollection.Item(0)
Dim myInputOperationMessage As OperationMessage = _
CType(New OperationInput(), OperationMessage)
Dim myXmlQualifiedName As _
New XmlQualifiedName("AddSoapIn", myDescription.TargetNamespace)
myInputOperationMessage.Message = myXmlQualifiedName
Dim myCollection(myOperationMessageCollection.Count -1 ) _
As OperationMessage
myOperationMessageCollection.CopyTo(myCollection, 0)
Console.WriteLine("Operation name(s) :")
Dim i As Integer
For i = 0 To myCollection.Length - 1
Console.WriteLine(" " & myCollection(i).Operation.Name)
Next i
' Add the OperationMessage to the collection.
myOperationMessageCollection.Add(myInputOperationMessage)
// Get the operation message for the Add operation.
OperationMessage myOperationMessage =
myOperationMessageCollection[0];
OperationMessage myInputOperationMessage =
(OperationMessage) new OperationInput();
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
"AddSoapIn", myDescription.TargetNamespace);
myInputOperationMessage.Message = myXmlQualifiedName;
OperationMessage[] myCollection =
new OperationMessage[myOperationMessageCollection.Count];
myOperationMessageCollection.CopyTo(myCollection, 0);
Console.WriteLine("Operation name(s) :");
for (int i = 0; i < myCollection.Length ; i++)
{
Console.WriteLine(" " + myCollection[i].Operation.Name);
}
// Add the OperationMessage to the collection.
myOperationMessageCollection.Add(myInputOperationMessage);
// Get the operation message for the Add operation.
OperationMessage^ myOperationMessage = myOperationMessageCollection[ 0 ];
OperationMessage^ myInputOperationMessage = dynamic_cast<OperationMessage^>(gcnew OperationInput);
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace );
myInputOperationMessage->Message = myXmlQualifiedName;
array<OperationMessage^>^myCollection = gcnew array<OperationMessage^>(myOperationMessageCollection->Count);
myOperationMessageCollection->CopyTo( myCollection, 0 );
Console::WriteLine( "Operation name(s) :" );
for ( int i = 0; i < myCollection->Length; i++ )
{
Console::WriteLine( " {0}", myCollection[ i ]->Operation->Name );
}
// Add the OperationMessage to the collection.
myOperationMessageCollection->Add( myInputOperationMessage );
// Get the operation message for the Add operation.
OperationMessage myOperationMessage = myOperationMessageCollection.
get_Item(0);
OperationMessage myInputOperationMessage = (OperationMessage)
new OperationInput();
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
"AddSoapIn", myDescription.get_TargetNamespace());
myInputOperationMessage.set_Message(myXmlQualifiedName);
OperationMessage myCollection[] =
new OperationMessage[myOperationMessageCollection.get_Count()];
myOperationMessageCollection.CopyTo(myCollection, 0);
Console.WriteLine("Operation name(s) :");
for (int i = 0; i < myCollection.get_Length(); i++) {
Console.WriteLine(" " + myCollection[i].get_Operation().
get_Name());
}
// Add the OperationMessage to the collection.
myOperationMessageCollection.Add(myInputOperationMessage);
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
OperationMessageCollection-Klasse
OperationMessageCollection-Member
System.Web.Services.Description-Namespace