This documentation is archived and is not being maintained.

SoapMessageStage Enumeration

Specifies the processing stage of a SOAP message.

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

public enum SoapMessageStage

Member nameDescription
Supported by the .NET Compact FrameworkBeforeSerializeThe 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.

Supported by the .NET Compact FrameworkAfterSerializeThe 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.

Supported by the .NET Compact FrameworkBeforeDeserializeThe 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.

Supported by the .NET Compact FrameworkAfterDeserializeThe 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.

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.

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.

// Process the SOAP message received and write to log file. 
public override void ProcessMessage(SoapMessage message) 
{
   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");
   }
}
   // Process the SOAP message received and write to log file.
public:
   void ProcessMessage(SoapMessage* message)
   {
      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(S"invalid stage");
      }
   }

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, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

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

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0
Show: