OperationMessageCollection.Item Property
.NET Framework 3.0
Gets or sets the value of an OperationMessage at the specified zero-based index.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
public: property OperationMessage^ default [int] { OperationMessage^ get (int index); void set (int index, OperationMessage^ value); }
/** @property */ public OperationMessage get_Item (int index) /** @property */ public void set_Item (int index, OperationMessage value)
Not applicable.
Parameters
- index
The zero-based index of the OperationMessage whose value is modified or returned.
Property Value
An OperationMessage.// 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 ); DisplayFlowInputOutput( myOperationMessageCollection, "Add" ); if ( myOperationMessageCollection->Contains( myOperationMessage ) == true ) { int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage ); Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex ); }
// 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);
DisplayFlowInputOutput(myOperationMessageCollection, "Add");
if (myOperationMessageCollection.Contains(myOperationMessage)
== true) {
int myIndex = myOperationMessageCollection.
IndexOf(myOperationMessage);
Console.WriteLine(" The index of the Add operation "
+ "message in the collection is : " + myIndex);
}
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: