WebHttpBinding Constructors

Definition

Initializes a new instance of the WebHttpBinding class.

Overloads

WebHttpBinding()

Initializes a new instance of the WebHttpBinding class.

WebHttpBinding(WebHttpSecurityMode)

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

WebHttpBinding(String)

Initializes a new instance of the WebHttpBinding class with a binding specified by its configuration name.

WebHttpBinding()

Initializes a new instance of the WebHttpBinding class.

C#
public WebHttpBinding();

Remarks

The default security mode is None, which specifies that no security is used.

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.

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

WebHttpBinding(WebHttpSecurityMode)

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

C#
public WebHttpBinding(System.ServiceModel.WebHttpSecurityMode securityMode);

Parameters

securityMode
WebHttpSecurityMode

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

Exceptions

The securityMode specified is not a valid WebHttpSecurityMode.

Remarks

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.

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

WebHttpBinding(String)

Initializes a new instance of the WebHttpBinding class with a binding specified by its configuration name.

C#
public WebHttpBinding(string configurationName);

Parameters

configurationName
String

The binding configuration name for the WebHttpBindingElement.

Exceptions

The binding element with the name configurationName was not found.

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1