title: Activation error in WCF web-service using basicHttpBinding, Windpws-Authentication & impersonation
body: <p>I am trying to host a WCF web service in IIS using Windows Authentication. Due to restrictions, we have to use the basicHttpBinding &amp; use impersonation (impersonate the caller's identity for accessing resources down the chain).</p>
  
  <p>I have declaratively enabled impersonation on the operation contract of my WCF service:</p>
  
  <pre><code> [OperationBehavior(Impersonation = ImpersonationOption.Required)]
  </code></pre>
  
  <p>My web.config is:</p>
  
  <pre><code>    &lt;system.serviceModel&gt;
        &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
            &lt;behavior&gt;
              &lt;serviceMetadata httpGetEnabled="true"/&gt;
              &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
            &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
        &lt;/behaviors&gt;
        &lt;bindings&gt;
          &lt;basicHttpBinding&gt;        
            &lt;binding name="basic"&gt;          
              &lt;security mode="TransportCredentialOnly"&gt;
                &lt;transport clientCredentialType="Windows"&gt;              
                &lt;/transport&gt;            
              &lt;/security&gt;          
            &lt;/binding&gt;
          &lt;/basicHttpBinding&gt;
        &lt;/bindings&gt;
        &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
        &lt;services&gt;
          &lt;service name="NotesService"&gt;
            &lt;endpoint address="http://Client1.osp.local:15000/NotesService/NotesService.svc" bindingConfiguration="basic" binding="basicHttpBinding"  contract="NotesService.ServiceContract.INotesService"&gt;
              &lt;identity&gt;
                &lt;servicePrincipalName value="HTTP/Client1.osp.local:15000"/&gt;            
              &lt;/identity&gt;          
            &lt;/endpoint&gt;        
          &lt;/service&gt;
        &lt;/services&gt;
      &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>However, I am getting an activation error. What am I missing?</p>
  
  <p>The error I am getting is:</p>
  
  <pre><code>The contract operation 'Process' requires Windows identity for automatic 
  impersonation. A Windows identity that represents the caller is not provided by 
  binding ('BasicHttpBinding','http://tempuri.org/') for contract 
  ('NotesService','http://tempuri.org/'.
  </code></pre>