OperationMessageCollection.Add Method
.NET Framework 3.0
Adds the specified OperationMessage to the end of the OperationMessageCollection.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
public int Add ( OperationMessage operationMessage )
public function Add ( operationMessage : OperationMessage ) : int
Not applicable.
Parameters
- operationMessage
The OperationMessage to add to the collection.
Return Value
The zero-based index where the operationMessage parameter has been added.// 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);
Windows 98, Windows Server 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
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: