This documentation is archived and is not being maintained.

WebHttpBinding Constructor (WebHttpSecurityMode)

Initializes a new instance of the WebHttpBinding class with the type of security used by the binding explicitly specified.

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

public WebHttpBinding(
	WebHttpSecurityMode securityMode
)

Parameters

securityMode
Type: System.ServiceModel.WebHttpSecurityMode
The value of WebHttpSecurityMode that specifies the type of security that is used to configure a service endpoint to receive HTTP requests.

ExceptionCondition
ArgumentOutOfRangeException

The securityMode specified is not a valid WebHttpSecurityMode.

To use transport-level security for endpoints configured with this binding, the Transport value must be specified as a parameter in the WebHttpBinding(WebHttpSecurityMode) constructor.

To use HTTP authentication without HTTPS, the TransportCredentialOnly value must be specified as a parameter in the WebHttpBinding(WebHttpSecurityMode) constructor.

The value of WebHttpSecurityMode cannot be set again after the binding instance is created.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: