title: How can I use WCF with the basichttpbinding only , SSL and Basic Authentication in IIS?
body: <p>Is it possible to setup a WCF service with SSL and Basic Authentication in IIS using only the <code>BasicHttpBinding-binding</code>? <br>
  (I can’t use the <code>wsHttpBinding-binding</code>)</p>
  <p>The site is hosted on IIS 7, with the following authentication set up:</p>
  <ul>
  <li>Anonymous access: <strong>OFF</strong></li>
  <li>Basic authentication: <strong>ON</strong></li>
  <li>Integrated Windows authentication: <strong>OFF</strong></li>
  </ul>
  <hr />
  <p><strong>Service Config:</strong></p>
  <pre><code>&lt;services&gt;
    &lt;service name=&quot;NameSpace.SomeService&quot;&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress=&quot;https://hostname/SomeService/&quot; /&gt;
        &lt;/baseAddresses&gt;
  
      &lt;/host&gt;
      &lt;!-- Service Endpoints --&gt;
      &lt;endpoint address=&quot;&quot; binding=&quot;basicHttpBinding&quot;
                bindingNamespace=&quot;http://hostname/SomeMethodName/1&quot;
                contract=&quot;NameSpace.ISomeInterfaceService&quot;
                name=&quot;Default&quot;
                        /&gt;
      &lt;endpoint address=&quot;mex&quot; binding=&quot;mexHttpsBinding&quot; contract=&quot;IMetadataExchange&quot;/&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior&gt;
        &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
        &lt;serviceMetadata httpsGetEnabled=&quot;true&quot;/&gt;
        &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
        &lt;serviceDebug includeExceptionDetailInFaults=&quot;false&quot;/&gt;
        &lt;exceptionShielding/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  </code></pre>
  <p>I tried 2 types of <em>bindings</em> with two different errors:</p>
  <ul>
  <li><strong>1. IIS Error:</strong>
  <blockquote>
  <p>'Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https].</p>
  </blockquote>
  <pre><code>&lt;bindings&gt;
     &lt;basicHttpBinding&gt;
       &lt;binding&gt;
         &lt;security mode=&quot;TransportCredentialOnly&quot;&gt;
           &lt;transport clientCredentialType=&quot;Basic&quot;/&gt;
         &lt;/security&gt;
       &lt;/binding&gt;
     &lt;/basicHttpBinding&gt;
   &lt;/bindings&gt;
  </code></pre>
  </li>
  <li><strong>2. IIS Error:</strong>
  <blockquote>
  <p>Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.</p>
  </blockquote>
  <pre><code> &lt;bindings&gt;
     &lt;basicHttpBinding&gt;
       &lt;binding&gt;
         &lt;security mode=&quot;Transport&quot;&gt;
           &lt;transport clientCredentialType=&quot;Basic&quot;/&gt;
         &lt;/security&gt;
       &lt;/binding&gt;
     &lt;/basicHttpBinding&gt;
    &lt;/bindings&gt;
  </code></pre>
  </li>
  </ul>
  <p>Does anyone know how to configure this correctly? (<em>if is it possible?</em>)</p>