Name

SoapMessage

Synopsis

This class represents a SOAP request or SOAP response used to communicate between a web service and proxy class. The SoapMessage class is used primarily for SOAP extensions. SOAP extensions, which derive from SoapExtension, receive a SoapMessage object at each SoapMessageStage as an argument to SoapExtension.ProcessMessage() method, which is called automatically by the ASP.NET framework.

The SoapMessage class provides methods that allow you to retrieve the web service method parameters and the return value encoded in the SOAP message. For a SoapClientMessage, you should use the GetInParameterValue() method if the SOAP message is in the SoapMessageStage.BeforeSerialize stage, or the GetOutParameterValue() method if it’s in the SoapMessageStage.AfterSerialize stage. For a SoapServerMessage, the reverse is true.

To verify that the parameters are available, you can use the EnsureInStage() or EnsureOutStage() method (a System.InvalidOperationException will be thrown if the message is not in a compatible stage). Alternatively, you can use the Stage property to determine the state when the SoapMessage was generated.

Public MustInherit Class SoapMessage
                  ' Public Instance Properties
   MustInherit Public ReadOnly Property Action As String  
   Public Property ContentType As String  
   Public ReadOnly Property Exception As SoapException  
   Public ReadOnly Property Headers As SoapHeaderCollection  
   MustInherit Public ReadOnly Property MethodInfo As LogicalMethodInfo MustInherit Public ...

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.