Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

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
AfterDeserializeThe 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.

AfterSerializeThe 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.

BeforeDeserializeThe 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.

BeforeSerializeThe 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.

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) 
   {
// <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>
   }

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.