title: WCF Authentication Binding Errors
body: <p>I have a WCF Service which also consumes a sharepoint userprofile service.
  I am getting this error when i try to run the service on IIS.</p>
  
  <blockquote>
    <p>The authentication schemes configured on the host
    ('IntegratedWindowsAuthentication') do not allow those configured on
    the binding 'WSHttpBinding' ('Anonymous').  Please ensure that the
    SecurityMode is set to Transport or TransportCredentialOnly. 
    Additionally, this may be resolved by changing the authentication
    schemes for this application through the IIS management tool, through
    the ServiceHost.Authentication.AuthenticationSchemes property, in the
    application configuration file at the 
    element, by updating the ClientCredentialType property on the binding,
    or by adjusting the AuthenticationScheme property on the
    HttpTransportBindingElement.</p>
  </blockquote>
  
  <p>Here is my web.config</p>
  
  <pre><code>&lt;bindings&gt;
  &lt;basicHttpBinding&gt;
  
      &lt;binding name="UserProfileServiceSoap" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true"&gt;
      &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
      &lt;security mode="TransportCredentialOnly"&gt;
      &lt;transport clientCredentialType="Ntlm" proxyCredentialType="None" realm="" /&gt;
      &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
      &lt;/security&gt;
      &lt;/binding&gt;
  
  &lt;/basicHttpBinding&gt;
  &lt;wsHttpBinding&gt;
  
      &lt;binding name="HttpBinding1" maxReceivedMessageSize="2147483647" receiveTimeout="10:00:00" openTimeout="10:00:00"
      sendTimeout="10:00:00" closeTimeout="10:00:00" bypassProxyOnLocal="false" transactionFlow="false"
      hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288000" allowCookies="false"&gt;
      &lt;security mode="None"/&gt;
      &lt;/binding&gt;
  
      &lt;binding name="WSHttpBinding_MessageSecurity" maxReceivedMessageSize="2147483647" receiveTimeout="10:00:00"
      openTimeout="10:00:00" sendTimeout="10:00:00" closeTimeout="10:00:00" bypassProxyOnLocal="false"
      transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288000" allowCookies="false"&gt;
      &lt;security mode="Message"&gt;
      &lt;transport clientCredentialType="Windows" proxyCredentialType="None" realm=""&gt;
      &lt;extendedProtectionPolicy policyEnforcement="Never"/&gt;
      &lt;/transport&gt;
      &lt;message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/&gt;
      &lt;/security&gt;
      &lt;/binding&gt;
  
  &lt;/wsHttpBinding&gt;
  &lt;/bindings&gt;
  
  services&gt;
  &lt;service name="UserProfileWcf.UserProfileService" behaviorConfiguration="UserProfileWcf.UserProfileServiceBehavior"&gt;
  &lt;!-- Service Endpoints --&gt;
  &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="HttpBinding1" contract="UserProfileWcf.ServiceContract.IUserProfileService" name="UserProfileServiceEndpoint"&gt;
  &lt;identity&gt;
  &lt;dns value="localhost"/&gt;
  &lt;/identity&gt;
  &lt;/endpoint&gt;
  &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
  &lt;/service&gt;
  &lt;/services&gt;
  &lt;behaviors&gt;
  &lt;serviceBehaviors&gt;
  &lt;behavior name="UserProfileWcf.UserProfileServiceBehavior"&gt;
  &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
  &lt;serviceMetadata httpGetEnabled="true"/&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="true"/&gt;
  &lt;dataContractSerializer maxItemsInObjectGraph="65536000"/&gt;
  &lt;serviceThrottling maxConcurrentSessions="2147483647"/&gt;
  &lt;/behavior&gt;
  &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
          &lt;client&gt;
              &lt;endpoint address="http://xyz/_vti_bin/userprofileservice.asmx"
                      binding="basicHttpBinding" bindingConfiguration="UserProfileServiceSoap"
                      contract="SharePointUserProfileService.UserProfileServiceSoap"
                      name="UserProfileServiceSoap" /&gt;
          &lt;/client&gt;
  </code></pre>
  
  <p>The same configuration works fine on my local machine. Where are my bindings going wrong ?</p>