Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - 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
public enum SoapMessageStage
public enum SoapMessageStage
 Member nameDescription
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.

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

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) throws Exception
{
    switch (message.get_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");
    }
} //ProcessMessage

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.