Edit

Share via


BasicHttpBinding.HostNameComparisonMode Property

Definition

Gets or sets a value that indicates whether the hostname is used to reach the service when matching the URI.

public:
 property System::ServiceModel::HostNameComparisonMode HostNameComparisonMode { System::ServiceModel::HostNameComparisonMode get(); void set(System::ServiceModel::HostNameComparisonMode value); };
public System.ServiceModel.HostNameComparisonMode HostNameComparisonMode { get; set; }
member this.HostNameComparisonMode : System.ServiceModel.HostNameComparisonMode with get, set
Public Property HostNameComparisonMode As HostNameComparisonMode

Property Value

The HostNameComparisonMode value that indicates whether the hostname is used to reach the service when matching on the URI. The default value is StrongWildcard, which ignores the hostname in the match.

Examples

The following example sets this property to indicate that an exact match is required.

BasicHttpBinding binding = new BasicHttpBinding();
binding.HostNameComparisonMode = HostNameComparisonMode.Exact;

The value of this property can also be set in the configuration file.

<configuration>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="Binding1"
                 hostNameComparisonMode ="Exact">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>

  </system.serviceModel>

</configuration>

Applies to