Freigeben über


Operation.Messages-Eigenschaft

Ruft die Auflistung von Instanzen der Message-Klasse ab, die durch die aktuelle Operation definiert wird.

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

Syntax

'Declaration
Public ReadOnly Property Messages As OperationMessageCollection
'Usage
Dim instance As Operation
Dim value As OperationMessageCollection

value = instance.Messages
public OperationMessageCollection Messages { get; }
public:
property OperationMessageCollection^ Messages {
    OperationMessageCollection^ get ();
}
/** @property */
public OperationMessageCollection get_Messages ()
public function get Messages () : OperationMessageCollection

Eigenschaftenwert

Eine OperationMessageCollection.

Hinweise

Da einer Operation genau ein OperationInput und genau ein OperationOutput zugeordnet ist, kann jeweils nur eine Instanz von diesen ein Member dieser Auflistung sein, und somit kann die Auflistung maximal zwei Member enthalten.

Beispiel

' Create an Operation.
Dim myOperation As New Operation()
myOperation.Name = myOperationName
Dim myInput As OperationMessage = _
   CType(New OperationInput(), OperationMessage)
myInput.Message = New XmlQualifiedName(myInputMesg)
Dim myOutput As OperationMessage = _
   CType(New OperationOutput(), OperationMessage)
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.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 = 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 );
// 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());

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

Operation-Klasse
Operation-Member
System.Web.Services.Description-Namespace