Freigeben über


OperationFlow-Enumeration

Gibt den Übertragungstyp an, den ein Endpunkt des xml-Webdiensts unterstützen kann.

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

Syntax

'Declaration
Public Enumeration OperationFlow
'Usage
Dim instance As OperationFlow
public enum OperationFlow
public enum class OperationFlow
public enum OperationFlow
public enum OperationFlow

Member

  Membername Beschreibung
None Gibt an, dass der Endpunkt des XML-Webdiensts keine Übertragungen empfängt. 
Notification Gibt an, dass der Endpunkt des XML-Webdiensts eine Meldung sendet. 
OneWay Gibt an, dass der Endpunkt des XML-Webdiensts eine Meldung empfängt. 
RequestResponse Gibt an, dass der Endpunkt des XML-Webdiensts eine Meldung empfängt und anschließend eine korrelierte Meldung sendet. 
SolicitResponse Gibt an, dass der Endpunkt des XML-Webdiensts eine Meldung sendet und anschließend eine korrelierte Meldung empfängt. 

Hinweise

Obwohl RequestResponse-Operationen bzw. SolicitResponse-Operationen im WSDL-Dokument (Web Services Description Language-Dokument) eine logische Korrelation zueinander aufweisen, werden die konkreten Korrelationsinformationen durch eine Bindung angegeben. Die Anforderungs- und Antwortmeldungen können z. B. als Teil von ein oder zwei tatsächlichen HTTP-Übertragungen ausgetauscht werden.

Beispiel

Das folgende Beispiel veranschaulicht die Verwendung der OperationFlow-Enumeration.

Imports System
Imports System.Xml
Imports System.Web.Services
Imports System.Web.Services.Description


Class MyOperationFlowSample
   
   Public Shared Sub Main()
      Try
         Dim myDescription As ServiceDescription = _
            ServiceDescription.Read("MathService_Input_vb.wsdl")
         Dim myPortTypeCollection As PortTypeCollection = _
            myDescription.PortTypes

         ' Get the OperationCollection for SOAP protocol.
         Dim myOperationCollection As OperationCollection = _
            myPortTypeCollection(0).Operations
         ' Get the OperationMessageCollection for the Add operation.
         Dim myOperationMessageCollection As OperationMessageCollection = _
            myOperationCollection(0).Messages

         ' Indicate that the endpoint or service receives no 
         ' transmissions (None).
         Console.WriteLine("myOperationMessageCollection does not " & _
            "contain any operation messages.")
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow)
         Console.WriteLine()
         
         ' Indicate that the endpoint or service receives a message (OneWay).
         Dim myInputOperationMessage As OperationMessage = _
            CType(New OperationInput(), OperationMessage)
         Dim myXmlQualifiedName As New XmlQualifiedName("AddSoapIn", _
            myDescription.TargetNamespace)
         myInputOperationMessage.Message = myXmlQualifiedName
         myOperationMessageCollection.Add(myInputOperationMessage)
         Console.WriteLine("myOperationMessageCollection contains " & _
            "only input operation messages.")
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow)
         Console.WriteLine()
         
         myOperationMessageCollection.Remove(myInputOperationMessage)
         
         ' Indicate that an endpoint or service sends a message (Notification).
         Dim myOutputOperationMessage As OperationMessage = _
            CType(New OperationOutput(), OperationMessage)
         Dim myXmlQualifiedName1 As New XmlQualifiedName("AddSoapOut", _
            myDescription.TargetNamespace)
         myOutputOperationMessage.Message = myXmlQualifiedName1
         myOperationMessageCollection.Add(myOutputOperationMessage)
         Console.WriteLine("myOperationMessageCollection contains only " & _
            "output operation messages.")
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow)
         Console.WriteLine()
         
         ' Indicate that an endpoint or service sends a message, then
         ' receives a correlated message (SolicitResponse).
         myOperationMessageCollection.Add(myInputOperationMessage)
         Console.WriteLine("myOperationMessageCollection contains " & _
            "an output operation message first, then " & _
            "an input operation message.")
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow)
         Console.WriteLine()
         
         ' Indicate that an endpoint or service receives a message,
         ' then sends a correlated message (RequestResponse).
         myOperationMessageCollection.Remove(myInputOperationMessage)
         myOperationMessageCollection.Insert(0, myInputOperationMessage)
         Console.WriteLine("myOperationMessageCollection contains " & _
            "an input operation message first, then " & _
            "an output operation message.")
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow)
         Console.WriteLine()
         
         myDescription.Write("MathService_new_vb.wsdl")
         Console.WriteLine( _
            "The file MathService_new_vb.wsdl was successfully written.")
      Catch e As Exception
         Console.WriteLine("Exception caught!!!")
         Console.WriteLine("Source : " & e.Source.ToString())
         Console.WriteLine("Message : " & e.Message.ToString())
      End Try
   End Sub 'Main
   Public Shared Sub DisplayOperationFlowDescription(myOperationFlow As OperationFlow)
      Select Case myOperationFlow
         Case OperationFlow.None
            Console.WriteLine("Indicates that the endpoint or service " & _
               "receives no transmissions (None).")
         Case OperationFlow.OneWay
            Console.WriteLine("Indicates that the endpoint or service " & _
               "receives a message (OneWay).")
         Case OperationFlow.Notification
            Console.WriteLine("Indicates that the endpoint or service " & _
               "sends a message (Notification).")
         Case OperationFlow.SolicitResponse
            Console.WriteLine("Indicates that the endpoint or service " & _
               "sends a message, then receives a correlated message " & _
               "(SolicitResponse).")
          Case OperationFlow.RequestResponse
            Console.WriteLine("Indicates that the endpoint or service " & _
               "receives a message, then sends a correlated message " & _
               "(RequestResponse).")
      End Select
   End Sub 'DisplayOperationFlowDescription
End Class 'MyOperationFlowSample
using System;
using System.Xml;
using System.Web.Services;
using System.Web.Services.Description;

class MyOperationFlowSample
{
   public static void Main()
   {
      try
      {
         ServiceDescription myDescription = 
            ServiceDescription.Read("MathService_Input_cs.wsdl");
         PortTypeCollection  myPortTypeCollection  = 
            myDescription.PortTypes;

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

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

         // Indicate that the endpoint or service receives no 
         // transmissions (None).
         Console.WriteLine("myOperationMessageCollection does not " +
            "contain any operation messages.");
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow);
         Console.WriteLine();

         // Indicate that the endpoint or service receives a message (OneWay).
         OperationMessage myInputOperationMessage = 
            (OperationMessage) new OperationInput();
         XmlQualifiedName myXmlQualifiedName = 
            new XmlQualifiedName("AddSoapIn", myDescription.TargetNamespace);
         myInputOperationMessage.Message = myXmlQualifiedName;
         myOperationMessageCollection.Add(myInputOperationMessage);
         Console.WriteLine("myOperationMessageCollection contains " +
            "only input operation messages.");
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow);
         Console.WriteLine();

         myOperationMessageCollection.Remove(myInputOperationMessage);

         // Indicate that an endpoint or service sends a message (Notification).
         OperationMessage myOutputOperationMessage = 
            (OperationMessage) new OperationOutput();
         XmlQualifiedName myXmlQualifiedName1 = new XmlQualifiedName
            ("AddSoapOut", myDescription.TargetNamespace);
         myOutputOperationMessage.Message = myXmlQualifiedName1;
         myOperationMessageCollection.Add(myOutputOperationMessage);
         Console.WriteLine("myOperationMessageCollection contains " +
            "only output operation messages.");
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow);
         Console.WriteLine();

         // Indicate that an endpoint or service sends a message, then
         // receives a correlated message (SolicitResponse).
         myOperationMessageCollection.Add(myInputOperationMessage);
         Console.WriteLine("'myOperationMessageCollection' contains " +
            "an output operation message first, then " +
            "an input operation message.");
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow);
         Console.WriteLine();

         // Indicate that an endpoint or service receives a message,
         // then sends a correlated message (RequestResponse).
         myOperationMessageCollection.Remove(myInputOperationMessage);
         myOperationMessageCollection.Insert(0, myInputOperationMessage);
         Console.WriteLine("myOperationMessageCollection contains " +
            "an input operation message first, then " +
            "an output operation message.");
         DisplayOperationFlowDescription(myOperationMessageCollection.Flow);
         Console.WriteLine();

         myDescription.Write("MathService_new_cs.wsdl");
         Console.WriteLine(
            "The file MathService_new_cs.wsdl was successfully written.");
      }
      catch(Exception e)
      {
         Console.WriteLine("Exception caught!!!");
         Console.WriteLine("Source : " + e.Source);
         Console.WriteLine("Message : " + e.Message);
      }
   }

   public static void DisplayOperationFlowDescription(
      OperationFlow myOperationFlow)
   {
      switch(myOperationFlow)
      {
         case OperationFlow.None:
            Console.WriteLine("Indicates that the endpoint or service " +
               "receives no transmissions (None).");
            break;
         case OperationFlow.OneWay:
            Console.WriteLine("Indicates that the endpoint or service " +
               "receives a message (OneWay).");
            break;
         case OperationFlow.Notification:
            Console.WriteLine("Indicates that the endpoint or service " +
               "sends a message (Notification).");
            break;
         case OperationFlow.SolicitResponse:
            Console.WriteLine("Indicates that the endpoint or service " +
               "sends a message, then receives a " +
               "correlated message (SolicitResponse).");
            break;
         case OperationFlow.RequestResponse:
            Console.WriteLine("Indicates that the endpoint or service " +
               "receives a message, then sends a " +
               "correlated message (RequestResponse).");
            break;
      }
   }
}
#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;

void DisplayOperationFlowDescription( OperationFlow myOperationFlow )
{
   switch ( myOperationFlow )
   {
      case OperationFlow::None:
         Console::WriteLine( "Indicates that the endpoint or service "
         "receives no transmissions (None)." );
         break;

      case OperationFlow::OneWay:
         Console::WriteLine( "Indicates that the endpoint or service "
         "receives a message (OneWay)." );
         break;

      case OperationFlow::Notification:
         Console::WriteLine( "Indicates that the endpoint or service "
         "sends a message (Notification)." );
         break;

      case OperationFlow::SolicitResponse:
         Console::WriteLine( "Indicates that the endpoint or service "
         "sends a message, then receives a "
         "correlated message (SolicitResponse)." );
         break;

      case OperationFlow::RequestResponse:
         Console::WriteLine( "Indicates that the endpoint or service "
         "receives a message, then sends a "
         "correlated message (RequestResponse)." );
         break;
   }
}

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

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

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

      // Indicate that the endpoint or service receives no
      // transmissions (None).
      Console::WriteLine( "myOperationMessageCollection does not "
      "contain any operation messages." );
      DisplayOperationFlowDescription( myOperationMessageCollection->Flow );
      Console::WriteLine();

      // Indicate that the endpoint or service receives a message (OneWay).
      OperationMessage^ myInputOperationMessage = dynamic_cast<OperationMessage^>(gcnew OperationInput);
      XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace );
      myInputOperationMessage->Message = myXmlQualifiedName;
      myOperationMessageCollection->Add( myInputOperationMessage );
      Console::WriteLine( "myOperationMessageCollection contains "
      "only input operation messages." );
      DisplayOperationFlowDescription( myOperationMessageCollection->Flow );
      Console::WriteLine();
      myOperationMessageCollection->Remove( myInputOperationMessage );

      // Indicate that an endpoint or service sends a message (Notification).
      OperationMessage^ myOutputOperationMessage = dynamic_cast<OperationMessage^>(gcnew OperationOutput);
      XmlQualifiedName^ myXmlQualifiedName1 = gcnew XmlQualifiedName( "AddSoapOut",myDescription->TargetNamespace );
      myOutputOperationMessage->Message = myXmlQualifiedName1;
      myOperationMessageCollection->Add( myOutputOperationMessage );
      Console::WriteLine( "myOperationMessageCollection contains "
      "only output operation messages." );
      DisplayOperationFlowDescription( myOperationMessageCollection->Flow );
      Console::WriteLine();

      // Indicate that an endpoint or service sends a message, then
      // receives a correlated message (SolicitResponse).
      myOperationMessageCollection->Add( myInputOperationMessage );
      Console::WriteLine( "'myOperationMessageCollection' contains "
      "an output operation message first, then "
      "an input operation message." );
      DisplayOperationFlowDescription( myOperationMessageCollection->Flow );
      Console::WriteLine();

      // Indicate that an endpoint or service receives a message,
      // then sends a correlated message (RequestResponse).
      myOperationMessageCollection->Remove( myInputOperationMessage );
      myOperationMessageCollection->Insert( 0, myInputOperationMessage );
      Console::WriteLine( "myOperationMessageCollection contains "
      "an input operation message first, then "
      "an output operation message." );
      DisplayOperationFlowDescription( myOperationMessageCollection->Flow );
      Console::WriteLine();
      myDescription->Write( "MathService_new_cs.wsdl" );
      Console::WriteLine( "The file MathService_new_cs.wsdl was successfully written." );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception caught!!!" );
      Console::WriteLine( "Source : {0}", e->Source );
      Console::WriteLine( "Message : {0}", e->Message );
   }
}
import System.*;  
import System.Xml.*;  
import System.Web.Services.*;  
import System.Web.Services.Description.*;  

class MyOperationFlowSample
{
    public static void main(String[] args)
    {
        try {
            ServiceDescription myDescription = ServiceDescription.
                Read("MathService_Input_jsl.wsdl");
            PortTypeCollection myPortTypeCollection = myDescription.
                get_PortTypes();
            // Get the OperationCollection for SOAP protocol.
            OperationCollection myOperationCollection = myPortTypeCollection.
                get_Item(0).get_Operations();
            // Get the OperationMessageCollection for the Add operation.
            OperationMessageCollection myOperationMessageCollection = 
                myOperationCollection.get_Item(0).get_Messages();
            // Indicate that the endpoint or service receives no 
            // transmissions (None).
            Console.WriteLine("myOperationMessageCollection does not " 
                + "contain any operation messages.");
            DisplayOperationFlowDescription(myOperationMessageCollection.
                get_Flow());
            Console.WriteLine();
            // Indicate that the endpoint or service receives a message
            // (OneWay).
            OperationMessage myInputOperationMessage = (OperationMessage)
                new OperationInput();
            XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
                "AddSoapIn", myDescription.get_TargetNamespace());
            myInputOperationMessage.set_Message(myXmlQualifiedName);
            myOperationMessageCollection.Add(myInputOperationMessage);
            Console.WriteLine("myOperationMessageCollection contains " 
                + "only input operation messages.");
            DisplayOperationFlowDescription(myOperationMessageCollection.
                get_Flow());
            Console.WriteLine();
            myOperationMessageCollection.Remove(myInputOperationMessage);
            // Indicate that an endpoint or service sends a message 
            // (Notification).
            OperationMessage myOutputOperationMessage = (OperationMessage)
                new OperationOutput();
            XmlQualifiedName myXmlQualifiedName1 = new XmlQualifiedName(
                "AddSoapOut", myDescription.get_TargetNamespace());
            myOutputOperationMessage.set_Message(myXmlQualifiedName1);
            myOperationMessageCollection.Add(myOutputOperationMessage);
            Console.WriteLine("myOperationMessageCollection contains " 
                + "only output operation messages.");
            DisplayOperationFlowDescription(myOperationMessageCollection.
                get_Flow());
            Console.WriteLine();
            // Indicate that an endpoint or service sends a message, then
            // receives a correlated message (SolicitResponse).
            myOperationMessageCollection.Add(myInputOperationMessage);
            Console.WriteLine("'myOperationMessageCollection' contains " 
                + "an output operation message first, then " 
                + "an input operation message.");
            DisplayOperationFlowDescription(myOperationMessageCollection.
                get_Flow());
            Console.WriteLine();
            // Indicate that an endpoint or service receives a message,
            // then sends a correlated message (RequestResponse).
            myOperationMessageCollection.Remove(myInputOperationMessage);
            myOperationMessageCollection.Insert(0, myInputOperationMessage);
            Console.WriteLine("myOperationMessageCollection contains " 
                + "an input operation message first, then " 
                + "an output operation message.");
            DisplayOperationFlowDescription(myOperationMessageCollection.
                get_Flow());
            Console.WriteLine();

            myDescription.Write("MathService_new_jsl.wsdl");
            Console.WriteLine("The file MathService_new_jsl.wsdl was "
                + "successfully written.");
        }
        catch (System.Exception e) {
            Console.WriteLine("Exception caught!!!");
            Console.WriteLine("Source : " + e.get_Source());
            Console.WriteLine("Message : " + e.get_Message());
        }
    } //main

    public static void DisplayOperationFlowDescription(
        OperationFlow myOperationFlow)
    {
        switch (myOperationFlow) {
            case OperationFlow.None:
                Console.WriteLine("Indicates that the endpoint or service " 
                    + "receives no transmissions (None).");
                break;
            case OperationFlow.OneWay:
                Console.WriteLine("Indicates that the endpoint or service " 
                    + "receives a message (OneWay).");
                break;
            case OperationFlow.Notification:
                Console.WriteLine("Indicates that the endpoint or service " 
                    + "sends a message (Notification).");
                break;
            case OperationFlow.SolicitResponse:
                Console.WriteLine("Indicates that the endpoint or service " 
                    + "sends a message, then receives a "
                    + "correlated message (SolicitResponse).");
                break;
            case OperationFlow.RequestResponse:
                Console.WriteLine("Indicates that the endpoint or service " 
                    + "receives a message, then sends a " 
                    + "correlated message (RequestResponse).");
                break;
        }
    } //DisplayOperationFlowDescription
} //MyOperationFlowSample

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

System.Web.Services.Description-Namespace