แก้ไข

แชร์ผ่าน


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.

public:
 WebHttpBinding();
public WebHttpBinding ();
Public Sub New ()

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

WebHttpBinding(WebHttpSecurityMode)

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

public:
 WebHttpBinding(System::ServiceModel::WebHttpSecurityMode securityMode);
public WebHttpBinding (System.ServiceModel.WebHttpSecurityMode securityMode);
new System.ServiceModel.WebHttpBinding : System.ServiceModel.WebHttpSecurityMode -> System.ServiceModel.WebHttpBinding
Public Sub New (securityMode As WebHttpSecurityMode)

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

WebHttpBinding(String)

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

public:
 WebHttpBinding(System::String ^ configurationName);
public WebHttpBinding (string configurationName);
new System.ServiceModel.WebHttpBinding : string -> System.ServiceModel.WebHttpBinding
Public Sub New (configurationName As String)

Parameters

configurationName
String

The binding configuration name for the WebHttpBindingElement.

Exceptions

The binding element with the name configurationName was not found.

Applies to