Partager via


SoapContext.MessageState Property

Gets or sets state information for a SOAP message.

Namespace: Microsoft.Web.Services3
Assembly: Microsoft.Web.Services3 (in microsoft.web.services3.dll)

Usage

'Usage
Dim soapContext1 As SoapContext

Dim returnValue As StateManager
returnValue = soapContext1.MessageState

Dim sampleValue As StateManager
soapContext1.MessageState = sampleValue

Syntax

'Declaration
Public Property MessageState() As StateManager
public StateManager MessageState {get; set;}
public:
property StateManager^ MessageState {
    StateManager^ get();
    void set(StateManager^ value);
}
public StateManager get_MessageState();
public void set_MessageState(StateManager);
public function get MessageState() : StateManager;
public function set MessageState(StateManager);

Property Value

A StateManager that contains the state information for a SOAP message.

Remarks

The Web Services Enhancements for Microsoft .NET (WSE) allows application code and SOAP filters to store state information. This state information is used by SOAP filters that execute later in the pipeline than the current application code or SOAP filter. For example, the following steps describe how a client output filter can store a security token in the state information so that a client input filter can use it to decrypt the SOAP response from a SOAP request/SOAP response pair.

  • The client output filter signs an outgoing SOAP request for a Web service by using a security token and then stores that security token in the client's state information.

  • The Web service input filter receives the SOAP request, verifies the digital signature, and stores the security token that signed the SOAP request in the Web service's state information.

  • The Web service output filter retrieves the security token that signed the SOAP request from the Web service's state information and uses it to encrypt a SOAP response, but it doesn't include the security token in the SOAP response.

  • A client output filter receives the SOAP response, determines that it is encrypted using a security token that is not in the SOAP message, and then retrieves the security token from the client's state information to decrypt the incoming SOAP response.

State information can be stored for an individual message (MessageState), a SOAP request and SOAP response pair (OperationState), or for the lifetime of a client's proxy class, which can span one or more SOAP request and SOAP response pairs(SessionState). The previous example uses operation state (OperationState).

For more information about creating custom policy assertions, see Custom Policy Assertions.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server

Target Platforms

See Also

Reference

SoapContext Class
SoapContext Members
Microsoft.Web.Services3 Namespace
OperationState
SessionState