This documentation is archived and is not being maintained.

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 class OperationFlow

Member nameDescription
NoneIndicates that the endpoint of the XML Web service receives no transmissions.
OneWayIndicates that the endpoint of the XML Web service receives a message.
NotificationIndicates that the endpoint of the XML Web service sends 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.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 );
   }
}
#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);
   }
}

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: