Operation::Messages Property

 

Gets the collection of instances of the Message class defined by the current Operation.

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

public:
property OperationMessageCollection^ Messages {
	OperationMessageCollection^ get();
}

Property Value

Type: System.Web.Services.Description::OperationMessageCollection^

The collection of instances of the Message class defined by the current Operation.

Because an Operation is associated with exactly one OperationInput and exactly one OperationOutput, only one instance of each can be a member of this collection, and thus the collection can have a maximum of two members.

// Create an Operation.
Operation^ myOperation = gcnew Operation;
myOperation->Name = myOperationName;
OperationMessage^ myInput = dynamic_cast<OperationMessage^>(gcnew OperationInput);
myInput->Message = gcnew XmlQualifiedName( myInputMesg );
OperationMessage^ myOutput = dynamic_cast<OperationMessage^>(gcnew OperationOutput);
myOutput->Message = gcnew XmlQualifiedName( myOutputMesg );

// Add messages to the OperationMessageCollection.
myOperation->Messages->Add( myInput );
myOperation->Messages->Add( myOutput );
Console::WriteLine( "Operation name is: {0}", myOperation->Name );

.NET Framework
Available since 1.1
Return to top
Show: