Exception
The HTTP request is unauthorized with client authentication scheme 'anonus us'. The authentication header was Ed from the server was 'negotiate, ntlm '.
Solution
1. Configure IIS
Website-> properties-> Directory Security-> authentication method: Select "Anonymous Access" and "Integrated Windows Authentication"
2. Configure the Config file of the WCF client:
There are 3 places: 1) security mode, 2) behaviorConfiguration of end point, 3) behaviors
<system.serviceModel> <bindings> <basicHttpBinding> <binding …> <readerQuotas … />
<security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" proxyCredentialType="Windows" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security>
</binding> </basicHttpBinding> </bindings> <client> <endpoint ... behaviorConfiguration="ImpersonationBehavior"/> </client> <behaviors> <endpointBehaviors> <behavior name="ImpersonationBehavior"> <clientCredentials> <windows allowedImpersonationLevel="Impersonation"/> </clientCredentials> </behavior> </endpointBehaviors> </behaviors></system.serviceModel>