title: WCF - Cannot obtain Metadata
body: <p>It is running in an Intranet using IIS 7 and it works fine whenever I enable Anonymous Authentication in the IIS Manager. If I disable it and try to run it using wcftestclient then I get the following error,</p>
  
  <pre><code>Error: Cannot obtain Metadata from http://myserver/testing/eval.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://myserver/testing/eval.svc    Metadata contains a reference that cannot be resolved: 'http://myserver/testing/eval.svc'.    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. 
  </code></pre>
  
  <p>This is my web.config file,</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;bindings&gt;
      &lt;wsHttpBinding&gt;
          &lt;binding name="Binding1"&gt;
              &lt;security mode="Transport"&gt;
                  &lt;transport clientCredentialType="Windows" /&gt;
                  &lt;message establishSecurityContext="true" /&gt;
              &lt;/security&gt;
          &lt;/binding&gt;
      &lt;/wsHttpBinding&gt;
      &lt;basicHttpBinding&gt;
          &lt;binding name="httpBinding"&gt;
              &lt;security mode="Transport"&gt;
                  &lt;transport clientCredentialType="Windows" /&gt;
              &lt;/security&gt;
          &lt;/binding&gt;
      &lt;/basicHttpBinding&gt;     
  &lt;/bindings&gt;
  
  &lt;services&gt;
    &lt;service behaviorConfiguration="ServiceBehavior" name="EvalServiceLibrary.EvalService"&gt;
      &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="Binding1" contract="EvalServiceLibrary.IEvalService"&gt;
        &lt;identity&gt;
          &lt;dns value="myserver.mydomain.com" /&gt;
        &lt;/identity&gt;
      &lt;/endpoint&gt;
      &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
      &lt;endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="ServiceBehavior"&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="false" /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  </code></pre>
  
  <p></p>
  
  <p>As you can see I'm populating metadata using mexHttpBinding endpoint. So any advice is welcome. </p>
  
  <p>Thank you,
  m0dest0. </p>