I encounter a problem with using the WebServiceHostFactory in IIS.
\"IIS specified authentication schemes \'IntegratedWindowsAuthentication, Anonymous\', but the binding
This is what worked for me. Adding a dummy endpoint early on (before the service host is opened) as shown below seems to have done the trick. (This MSDN article hinted at this http://msdn.microsoft.com/en-us/library/bb412178.aspx.)
public class MyWebServiceHost : WebServiceHost
{
public MyWebServiceHost (Type serviceType, params Uri[] baseAddresses) : base(serviceType, baseAddresses)
{
// Inserting this dummy endpoint config seemingly does the trick:
AddServiceEndpoint(typeof(IMyContract), new WebHttpBinding(), string.Empty);
}
protected override void ApplyConfiguration()
{
// Typical programmatic configuration here per:
// http://msdn.microsoft.com/en-us/library/aa395224.aspx
}
}
I'm guessing this prevents WebServiceHost from creating a default endpoint, and thus shutting down a bunch of functionality.