Export (0) Print
Expand All

BasicHttpMessageSecurity Class

Configures message-level security settings for BasicHttpBinding.

System.Object
  System.ServiceModel.BasicHttpMessageSecurity

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

public sealed class BasicHttpMessageSecurity

The BasicHttpMessageSecurity type exposes the following members.

  NameDescription
Public methodBasicHttpMessageSecurityInitializes a new instance of the BasicHttpMessageSecurity class.
Top

  NameDescription
Public propertyAlgorithmSuiteSpecifies the algorithm suite to use with BasicHttpMessageSecurity.
Public propertyClientCredentialTypeSpecifies the type of credential with which the client authenticates.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodShouldSerializeAlgorithmSuiteReturns whether the algorithm suite to be used for securing messages at the SOAP level should be serialized.
Public methodShouldSerializeClientCredentialTypeReturns whether the client credential type should be serialized.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

BasicHttpBinding binding = new BasicHttpBinding("myBinding");
binding.Name = "binding1";
binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
binding.Security.Mode = BasicHttpSecurityMode.Message;

BasicHttpSecurity security = binding.Security;
BasicHttpMessageSecurity msgSecurity = security.Message;

SecurityAlgorithmSuite sas = msgSecurity.AlgorithmSuite;
BasicHttpMessageCredentialType credType = msgSecurity.ClientCredentialType;

Console.WriteLine("The algorithm suite used is {0}", sas.ToString());
Console.WriteLine("The client credential type used is {0}", credType.ToString());
<bindings>
  <!-- 
        Following is the expanded configuration section for a BasicHttpBinding.
        Each property is configured with the default value.
        See the TransportSecurity, and MessageSecurity samples in the
        Basic directory to learn how to configure these features.
        -->
  <basicHttpBinding>
    <binding name="BasicBinding" 
             hostNameComparisonMode="StrongWildcard" 
             receiveTimeout="00:10:00"
             sendTimeout="00:10:00"
             openTimeout="00:10:00"
             closeTimeout="00:10:00"
             maxReceivedMessageSize="65536" 
             maxBufferSize="65536" 
             maxBufferPoolSize="524288" 
             transferMode="Buffered" 
             messageEncoding="Text" 
             textEncoding="utf-8"
             bypassProxyOnLocal="false"
             useDefaultWebProxy="true" >
      <security mode="None" />
    </binding>
  </basicHttpBinding>
</bindings>

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft