title: VS2012 WCF REST Service - Error: Cannot obtain metadata
body: <p>I have built a WCF REST web service (WCF Service Application) and when I debug with Visual Studio 2012, it will spin up the WCF Test Client app and try to add my web service. I am getting the following error:</p>
  
  <pre><code>Error: Cannot obtain Metadata from http://localhost:50925/Service1.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://localhost:50925/Service1.svc    Metadata contains a reference that cannot be resolved: 'http://localhost:50925/Service1.svc'.    Content Type application/soap+xml; charset=utf-8 was not supported by service 
  </code></pre>
  
  <p>I have visited the MSDN document linked above and I believe I have set up my web.config correctly.</p>
  
  <p>Web.config:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
  &lt;system.web&gt;
   &lt;compilation debug="true" strict="false" explicit="true" targetFramework="4.0" /&gt;
  &lt;/system.web&gt;  
  &lt;system.serviceModel&gt;   
  &lt;services&gt;
    &lt;service name="Service1" behaviorConfiguration="Service1Behavior"&gt;       
      &lt;endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"&gt;     &lt;/endpoint&gt;
    &lt;/service&gt;
  &lt;/services&gt;  
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="Service1Behavior"&gt;
        &lt;serviceMetadata httpGetEnabled="true"/&gt;     
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  &lt;/system.serviceModel&gt;
  &lt;system.webServer&gt;
     &lt;modules runAllManagedModulesForAllRequests="true"/&gt;   
  &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I still continue to receive the same error message. I am new to WCF / VS 2012 and .Net 4.0, but I am fluent in VS2008 .Net 2.0.</p>