OperationFlow 列挙体

XML Web サービスのエンドポイントでサポートできる伝送の種類を指定します。

<Serializable>
Public Enum OperationFlow
[C#]
[Serializable]
public enum OperationFlow
[C++]
[Serializable]
__value public enum OperationFlow
[JScript]
public
   Serializable
enum OperationFlow

解説

WSDL (Web Services Description Language) ドキュメント内で要求応答操作または請求応答操作が論理的に相関関係にあったとしても、具体的な相関情報がバインディングによって指定されます。たとえば、要求メッセージと応答メッセージを 1 つまたは 2 つの実際の HTTP 伝送の一部として交換できます。

メンバ

メンバ名 説明
None XML Web サービスのエンドポイントが伝送を受信しないことを示します。
Notification XML Web サービスのエンドポイントからメッセージを送信することを示します。
OneWay XML Web サービスのエンドポイントでメッセージを受信することを示します。
RequestResponse XML Web サービスのエンドポイントでメッセージを受信した後に、相関関係にあるメッセージを送信します。
SolicitResponse XML Web サービスのエンドポイントでメッセージを送信した後に、相関関係にあるメッセージを受信します。

使用例

[Visual Basic, C#, C++] OperationFlow 列挙体を使用する例を次に示します。

 
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

[C#] 
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;
      }
   }
}

[C++] 
#using <mscorlib.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(S"Indicates that the endpoint or service "
         S"receives no transmissions (None).");
      break;
   case OperationFlow::OneWay:
      Console::WriteLine(S"Indicates that the endpoint or service "
         S"receives a message (OneWay).");
      break;
   case OperationFlow::Notification:
      Console::WriteLine(S"Indicates that the endpoint or service "
         S"sends a message (Notification).");
      break;
   case OperationFlow::SolicitResponse:
      Console::WriteLine(S"Indicates that the endpoint or service "
         S"sends a message, then receives a "
         S"correlated message (SolicitResponse).");
      break;
   case OperationFlow::RequestResponse:
      Console::WriteLine(S"Indicates that the endpoint or service "
         S"receives a message, then sends a "
         S"correlated message (RequestResponse).");
      break;
   }
}

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

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

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

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

      // Indicate that the endpoint or service receives a message (OneWay).
      OperationMessage* myInputOperationMessage =
         dynamic_cast<OperationMessage*> (new OperationInput());
      XmlQualifiedName* myXmlQualifiedName =
         new XmlQualifiedName(S"AddSoapIn", myDescription->TargetNamespace);
      myInputOperationMessage->Message = myXmlQualifiedName;
      myOperationMessageCollection->Add(myInputOperationMessage);
      Console::WriteLine(S"myOperationMessageCollection contains "
         S"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*> (new OperationOutput());
      XmlQualifiedName* myXmlQualifiedName1 = new XmlQualifiedName
         (S"AddSoapOut", myDescription->TargetNamespace);
      myOutputOperationMessage->Message = myXmlQualifiedName1;
      myOperationMessageCollection->Add(myOutputOperationMessage);
      Console::WriteLine(S"myOperationMessageCollection contains "
         S"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(S"'myOperationMessageCollection' contains "
         S"an output operation message first, then "
         S"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(S"myOperationMessageCollection contains "
         S"an input operation message first, then "
         S"an output operation message.");
      DisplayOperationFlowDescription(myOperationMessageCollection->Flow);
      Console::WriteLine();

      myDescription->Write(S"MathService_new_cs.wsdl");
      Console::WriteLine(
         S"The file MathService_new_cs.wsdl was successfully written.");
   }
   catch(Exception* e)
   {
      Console::WriteLine(S"Exception caught!!!");
      Console::WriteLine(S"Source : {0}", e->Source);
      Console::WriteLine(S"Message : {0}", e->Message);
   }
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.Web.Services.Description

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: System.Web.Services (System.Web.Services.dll 内)

参照

System.Web.Services.Description 名前空間