BasicHttpBinding.Security Property

Gets the type of security used with this binding.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public BasicHttpSecurity Security { get; }

Property Value

Type: System.ServiceModel.BasicHttpSecurity
The BasicHttpSecurity that is used with this binding. The default value is None.

By default, the SOAP message is not secured and the client is not authenticated. To use a non-default type of security, use the BasicHttpBinding(BasicHttpSecurityMode) constructor or set the type of security for an existing binding using the Mode property.


            BasicHttpBinding bDefaultHttpBinding = new BasicHttpBinding();
            //Output txtSecurityMode: None
            string txtDefaultSecurityMode = bDefaultHttpBinding.Security.Mode.ToString();

            BasicHttpBinding bTHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
            //Output txtSecurityMode: Transport
            string txtTSecurityMode = bTHttpBinding.Security.Mode.ToString();

            BasicHttpBinding bTOHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
            //Output txtSecurityMode: TransportCredentialOnly
            string txtTOSecurityMode = bTOHttpBinding.Security.Mode.ToString();



Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: