SoapMessageStage Enumeration
Collapse the table of content
Expand the table of content

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

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


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


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


The stage just prior to a SoapMessage being serialized.

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:
      case SoapMessageStage.AfterSerialize:
         WriteOutput( message );
      case SoapMessageStage.BeforeDeserialize:
         WriteInput( message );
      case SoapMessageStage.AfterDeserialize:
         throw new Exception("invalid stage");

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft