SoapMessageStage Enumeration (System.Web.Services.Protocols)

Switch View :
ScriptFree
.NET Framework Class Library
SoapMessageStage Enumeration

Specifies the processing stage of a SOAP message.

Namespace:  System.Web.Services.Protocols
Assembly:  System.Web.Services (in System.Web.Services.dll)
Syntax

Visual Basic
Public Enumeration SoapMessageStage
C#
public enum SoapMessageStage
Visual C++
public enum class SoapMessageStage
F#
type SoapMessageStage
Members

Member name Description
BeforeSerialize The stage just prior to a SoapMessage being serialized.

During SoapClientMessage processing, the BeforeSerialize stage occurs after a client invokes an XML Web service method, but prior to the invocation being serialized.

During SoapServerMessage processing, the BeforeSerialize stage occurs after the invocation to the XML Web service method returns, but prior to the return values being serialized and sent over the wire back to the client.

AfterSerialize The stage just after a SoapMessage is serialized, but before the SOAP message is sent over the wire.

During SoapClientMessage processing, the AfterSerialize stage occurs after a client invokes an XML Web service method and the parameters are serialized into XML, but prior to the SOAP message containing that XML is sent over the network.

During SoapServerMessage processing, the AfterSerialize stage occurs after an XML Web service method returns and any return values are serialized into XML, but prior to the SOAP message containing that XML is sent over the network.

BeforeDeserialize The stage just before a SoapMessage is deserialized from the SOAP message sent across the network into an object.

During SoapClientMessage processing, the BeforeDeserialize stage occurs after the network response from an XML Web service method invocation has been received, but just before the response containing the SOAP message is deserialized into an object.

During SoapServerMessage processing, the BeforeDeserialize stage occurs after a network request containing the SOAP message for an XML Web service method invocation is received by the Web server, but prior to the SOAP message being deserialized into an object.

AfterDeserialize The stage just after a SoapMessage is deserialized from a SOAP message into an object.

During SoapClientMessage processing, the AfterDeserialize stage occurs after the SOAP message containing the response from an XML Web service method invocation has been deserialized into an object, but prior to the client receiving the deserialized results.

During SoapServerMessage processing, the AfterDeserialize stage occurs after a network request containing a SOAP message representing an XML Web service method invocation is deserialized into an object, but prior to the method on that object representing the XML Web service method is called.

Remarks

ASP.NET provides an extensibility mechanism for calling Web Services using SOAP. The extensibility mechanism revolves around a SoapExtension that can inspect or modify a message at specific stages in message processing on either the client or the server. This enumeration specifies the processing stage of the SoapMessage.

Examples

The following code example is a fragment of a SOAP extension, which implements the ProcessMessage method. Within the ProcessMessage method, processing of a SoapMessage is handled specific to the SoapMessageStage.

Visual Basic

   ' Process the SOAP message received and write to log file.
   Public Overrides Sub ProcessMessage(message As SoapMessage)
' <Snippet5>
      Select Case message.Stage
         Case SoapMessageStage.BeforeSerialize
         Case SoapMessageStage.AfterSerialize
            WriteOutput(message)
         Case SoapMessageStage.BeforeDeserialize
            WriteInput(message)
         Case SoapMessageStage.AfterDeserialize
         Case Else
               Throw New Exception("invalid stage")
      End Select
' </Snippet2>
 End Sub 'ProcessMessage


C#

   // Process the SOAP message received and write to log file.
   public override void ProcessMessage(SoapMessage message) 
   {
// <Snippet5>
      switch (message.Stage) 
      {
         case SoapMessageStage.BeforeSerialize:
            break;
         case SoapMessageStage.AfterSerialize:
            WriteOutput( message );
            break;
         case SoapMessageStage.BeforeDeserialize:
            WriteInput( message );
            break;
         case SoapMessageStage.AfterDeserialize:
            break;
         default:
            throw new Exception("invalid stage");
      }
// </Snippet2>
   }


Visual C++

   // Process the SOAP message received and write to log file.
   void ProcessMessage( SoapMessage^ message )
   {
// <Snippet5>
      switch ( message->Stage )
      {
         case SoapMessageStage::BeforeSerialize:
            break;
         case SoapMessageStage::AfterSerialize:
            WriteOutput( message );
            break;
         case SoapMessageStage::BeforeDeserialize:
            WriteInput( message );
            break;
         case SoapMessageStage::AfterDeserialize:
            break;
         default:
            throw gcnew Exception( "invalid stage" );
      }
// </Snippet2>
   }


Version Information

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference