Export (0) Print
Expand All
Expand Minimize

OperationFlow Enumeration

Specifies the type of transmission an endpoint of the XML Web service can support.

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

public enum OperationFlow
public enum OperationFlow
public enum OperationFlow

 Member nameDescription
NoneIndicates that the endpoint of the XML Web service receives no transmissions. 
NotificationIndicates that the endpoint of the XML Web service sends a message. 
OneWayIndicates that the endpoint of the XML Web service receives a message. 
RequestResponseIndicates that the endpoint of the XML Web service receives a message, then sends a correlated message. 
SolicitResponseIndicates that the endpoint of the XML Web service sends a message, then receives a correlated message. 

Although request-response or solicit-response operations are logically correlated in the Web Services Description Language (WSDL) document, the concrete correlation information will be specified by a binding. For example, the request and response messages can be exchanged as part of one or two actual HTTP transmissions.

The following sample demonstrates the use of the OperationFlow enumeration.

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;
      }
   }
}

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

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