Export (0) Print
Expand All

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 OperationMessageCollection Messages { get; }
/** @property */
public OperationMessageCollection get_Messages ()

public function get Messages () : OperationMessageCollection

Not applicable.

Property Value

An OperationMessageCollection.

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 = new Operation();
myOperation.Name = myOperationName;
OperationMessage myInput = (OperationMessage)new OperationInput();
myInput.Message =  new XmlQualifiedName(myInputMesg);
OperationMessage myOutput = (OperationMessage)new OperationOutput();
myOutput.Message = new XmlQualifiedName(myOutputMesg);

// Add messages to the OperationMessageCollection.
myOperation.Messages.Add(myInput);
myOperation.Messages.Add(myOutput);
Console.WriteLine("Operation name is: " + myOperation.Name);     

// Create an Operation.
Operation myOperation = new Operation();
myOperation.set_Name(myOperationName);
OperationMessage myInput = (OperationMessage)new OperationInput();
myInput.set_Message(new XmlQualifiedName(myInputMesg));
OperationMessage myOutput = (OperationMessage)new OperationOutput();
myOutput.set_Message(new XmlQualifiedName(myOutputMesg));
// Add messages to the OperationMessageCollection.
myOperation.get_Messages().Add(myInput);
myOperation.get_Messages().Add(myOutput);
Console.WriteLine("Operation name is: " + myOperation.get_Name());

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.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft