WSHttpBinding Constructor (SecurityMode, Boolean)

 

Initializes a new instance of the WSHttpBinding class with a specified type of security used by the binding and a value that indicates whether a reliable session is enabled.

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

public WSHttpBinding(
	SecurityMode securityMode,
	bool reliableSessionEnabled
)

Parameters

securityMode
Type: System.ServiceModel.SecurityMode

The value of SecurityMode that specifies the type of security that is used with the SOAP message and for the client.

reliableSessionEnabled
Type: System.Boolean

true if a reliable session is enabled; otherwise, false.

The following example shows how to initialize a new instance of the WSHttpBinding class with a securityMode and reliableSessionEnabled parameter.

// securityMode is Message
// reliableSessionEnabled is true
WSHttpBinding binding = new WSHttpBinding(SecurityMode.Message, true);
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;

.NET Framework
Available since 3.0
Return to top
Show: