title: How to fix "The HTTP request was forbidden with client authentication scheme 'Anonymous'"
body: <p>I'm having some issues implementing a client that talks to a WCF service. It's a WCF hosted by another company so I don't have access to its code. I used the Connected Service provider tool in Visual Studio to generate the client code so that I could make requests and everything works fine on my local machine. I am having an issue on our development environment where I receive the following error if I try to make a request with the client:</p>
  
  <pre><code>The HTTP request was forbidden with client authentication scheme 'Anonymous'
  </code></pre>
  
  <p>I've been looking at the client code (it's a lot of code) which is generated by the Provider tool and I think it may have something to do with the following block of code.</p>
  
  <pre><code>System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
  result.MaxBufferSize = int.MaxValue;
  result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
  result.MaxReceivedMessageSize = int.MaxValue;
  result.AllowCookies = true;
  result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
  return result;
  </code></pre>