Share via


SoapContext.Security Property

Gets the security header associated with the SOAP message.

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

Usage

'Usage
Dim soapContext1 As SoapContext

Dim returnValue As Security
returnValue = soapContext1.Security

Dim sampleValue As Security
soapContext1.Security = sampleValue

Syntax

'Declaration
Public Property Security() As Security
public Security Security {get; set;}
public:
property Security^ Security {
    Security^ get();
public private:
    void set(Security^ value);
}
public Security get_Security();
public void set_Security(Security);
public function get Security() : Security;
public function set 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 the Security property to populate a WS-Security header containing that contains security tokens that are used to digitally sign or encrypt a message. To digitally sign a SOAP message, add a MessageSignature to the Elements property. To encrypt a SOAP message, add an EncryptedData to the Elements property. To add a security token to the SOAP message, add the security token to the Tokens property.

Note

When a security token is embedded in a digital signature, do not add the security token to the Tokens property. The XML element for the security token must have a unique Id attribute. When the security token is embedded in the digital signature, a unique Id attribute is created. However, if the security token is then added to the Tokens property, a second XML element for the security token is added to the SOAP message with the same Id attribute and this results in an invalid SOAP message. For more details about how to embed a security token in a digital signature, see SecurityTokenReference.

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
UsernameToken
X509SecurityToken
Security