OperationMessage Klasse

Definition

Stellt einen Meldungstyp dar, der durch die Aktion eines XML-Webdiensts übergeben wird.

public ref class OperationMessage abstract : System::Web::Services::Description::DocumentableItem
public ref class OperationMessage abstract : System::Web::Services::Description::NamedItem
public abstract class OperationMessage : System.Web.Services.Description.DocumentableItem
public abstract class OperationMessage : System.Web.Services.Description.NamedItem
type OperationMessage = class
    inherit DocumentableItem
type OperationMessage = class
    inherit NamedItem
Public MustInherit Class OperationMessage
Inherits DocumentableItem
Public MustInherit Class OperationMessage
Inherits NamedItem
Vererbung
OperationMessage
Vererbung
OperationMessage
Abgeleitet

Beispiele

#using <System.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>

using namespace System;
using namespace System::Xml;
using namespace System::Web::Services;
using namespace System::Web::Services::Description;

int main()
{
   try
   {
      ServiceDescription^ myDescription = ServiceDescription::Read( "MathService_input_cs.wsdl" );
      PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes;

      // Get the OperationCollection for the SOAP protocol.
      OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations;

      // Get the OperationMessageCollection for the Add operation.
      OperationMessageCollection^ myOperationMessageCollection = myOperationCollection[ 0 ]->Messages;

      OperationMessage^ myInputOperationMessage = (OperationMessage^)(gcnew OperationInput);
      XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace );
      myInputOperationMessage->Message = myXmlQualifiedName;

      myOperationMessageCollection->Insert( 0, myInputOperationMessage );

      // Display the operation name of the InputMessage.
      Console::WriteLine( "The operation name is {0}", myInputOperationMessage->Operation->Name );

      // Add the OperationMessage to the collection.
      myDescription->Write( "MathService_new_cs.wsdl" );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception caught!!!" );
      Console::WriteLine( "Source : {0}", e->Source );
      Console::WriteLine( "Message : {0}", e->Message );
   }
}
using System;
using System.Xml;
using System.Web.Services;
using System.Web.Services.Description;

class MyOperationMessageSample
{
   static void Main()
   {
      try
      {
         ServiceDescription myDescription =
            ServiceDescription.Read("MathService_input_cs.wsdl");
         PortTypeCollection myPortTypeCollection  =
            myDescription.PortTypes;

         // Get the OperationCollection for the SOAP protocol.
         OperationCollection myOperationCollection =
            myPortTypeCollection[0].Operations;

         // Get the OperationMessageCollection for the Add operation.
         OperationMessageCollection myOperationMessageCollection =
            myOperationCollection[0].Messages;

         OperationMessage myInputOperationMessage =
            (OperationMessage) new OperationInput();
         XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
            "AddSoapIn", myDescription.TargetNamespace);
         myInputOperationMessage.Message = myXmlQualifiedName;
         myOperationMessageCollection.Insert(0, myInputOperationMessage);

         // Display the operation name of the InputMessage.
         Console.WriteLine("The operation name is " +
            myInputOperationMessage.Operation.Name);

         // Add the OperationMessage to the collection.
         myDescription.Write("MathService_new_cs.wsdl");
      }
      catch(Exception e)
      {
         Console.WriteLine("Exception caught!!!");
         Console.WriteLine("Source : " + e.Source);
         Console.WriteLine("Message : " + e.Message);
      }
   }
}
Imports System.Xml
Imports System.Web.Services
Imports System.Web.Services.Description

Class MyOperationMessageSample

   Shared Sub Main()
      Try
         Dim myDescription As ServiceDescription = _
            ServiceDescription.Read("MathService_input_vb.wsdl")
         Dim myPortTypeCollection As PortTypeCollection = _
            myDescription.PortTypes

         ' Get the OperationCollection for the SOAP protocol.
         Dim myOperationCollection As OperationCollection = _
            myPortTypeCollection(0).Operations

         ' Get the OperationMessageCollection for the Add operation.
         Dim myOperationMessageCollection As OperationMessageCollection =  _
               myOperationCollection(0).Messages

         Dim myInputOperationMessage As OperationMessage = _
            CType(New OperationInput(), OperationMessage)
         Dim myXmlQualifiedName As New XmlQualifiedName("AddSoapIn", _
            myDescription.TargetNamespace)
         myInputOperationMessage.Message = myXmlQualifiedName
         myOperationMessageCollection.Insert(0, myInputOperationMessage)
         ' Display the operation name of the InputMessage.
         Console.WriteLine("The operation name is " & _
            myInputOperationMessage.Operation.Name)

         ' Add the OperationMessage to the collection.
         myDescription.Write("MathService_new_vb.wsdl")
      Catch e As Exception
         Console.WriteLine("Exception caught!!!")
         Console.WriteLine("Source : " & e.Source.ToString())
         Console.WriteLine("Message : " & e.Message.ToString())
      End Try
   End Sub
End Class

Hinweise

Diese Klasse dient als Basisklasse für die folgenden Klassen:

Konstruktoren

OperationMessage()

Initialisiert eine neue Instanz der OperationMessage-Klasse.

Eigenschaften

Documentation

Ruft die Textdokumentation für die Instanz von DocumentableItem ab oder legt diese fest.

(Geerbt von DocumentableItem)
DocumentationElement

Ruft das Dokumentationselement für das DocumentableItem ab oder legt dieses fest.

(Geerbt von DocumentableItem)
ExtensibleAttributes

Ruft ein Array vom Typ XmlAttribute ab, das Attributerweiterungen von WSDL darstellt, um dem WS-I-Basisprofil 1.1 (Web Services Interoperability) zu entsprechen, oder legt dieses fest.

(Geerbt von DocumentableItem)
Extensions

Ruft den diesem ServiceDescriptionFormatExtensionCollection zugeordneten DocumentableItem ab.

(Geerbt von DocumentableItem)
Message

Ruft eine abstrakte, typisierte Definition der übermittelten Daten ab oder legt diese fest.

Name

Ruft den Namen der OperationMessage ab oder legt diesen fest.

Name

Ruft den Namen des Elements ab oder legt diesen fest.

(Geerbt von NamedItem)
Namespaces

Ruft das Wörterbuch der Namespacepräfixe und Namespaces ab, die verwendet werden, um die Namespacepräfixe und Namespaces beim Erstellen eines ServiceDescription-Objekts beizubehalten.

(Geerbt von DocumentableItem)
Operation

Ruft die Operation ab, zu deren Membern OperationMessage gehört.

Methoden

Equals(Object)

Bestimmt, ob das angegebene Objekt gleich dem aktuellen Objekt ist.

(Geerbt von Object)
GetHashCode()

Fungiert als Standardhashfunktion.

(Geerbt von Object)
GetType()

Ruft den Type der aktuellen Instanz ab.

(Geerbt von Object)
MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.

(Geerbt von Object)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Gilt für: