Share via


SoapContext.Security Property

Gets the security header associated with the SOAP message.

Namespace: Microsoft.Web.Services2
Assembly: Microsoft.Web.Services2 (in microsoft.web.services2.dll)

Usage

'Usage
Dim soapContext1 As SoapContext

Dim returnValue As Security
returnValue = soapContext1.Security

Syntax

'Declaration
Public ReadOnly Property Security() As Security
public Security Security {get;}
public: property Security^ Security{
    Security^ get();
}
public Security get_Security();
public function get Security() : Security;

Property Value

A Security representing the security header for the ultimate receiver of the SOAP message.

Remarks

When sending a SOAP message, use this member to populate a WS-Security header containing the security tokens used to digitally sign or encrypt a message. The Web Services Enhancements (WSE) supports adding UsernameToken and X509SecurityToken security tokens, which represent a user name and password and an X.509 certificate, respectively.

Typical usage of this member follows this pattern:

  • Get an instance of the SoapContext class. An instance of the SoapContext class can be obtained by XML Web service clients using the RequestSoapContext or ResponseSoapContext properties.

  • Create an instance of a class representing a security token, such as UsernameToken or X509SecurityToken .

  • Populate the contents of the security token class with the security credentials.

  • Add the security token to the Tokens collection of the Security property.

  • Optionally, digitally sign or encrypt the message.

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 Longhorn, and Windows 2000

Target Platforms

Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, Pocket PC, Windows CE, Smart Phone

See Also

Reference

SoapContext Class
Microsoft.Web.Services2 Namespace
UsernameToken
X509SecurityToken
Security

Other Resources

SoapContext Members