title: WCF HTTP 504 Error
body: <p>I have the following problem. I am using Entity Framework to connect to a SQL Azure and that works(I tested it in a Test Project). </p>
  
  <p>But when i try to get it through WCF RESTful service it throws Error 504.</p>
  
  <p>My Operation Contract:</p>
  
  <pre><code>[ServiceContract]
  public interface IService
  {
      [OperationContract]
      [WebGet(UriTemplate = "/Artikli", ResponseFormat = WebMessageFormat.Json)]
      IEnumerable&lt;Artikal&gt; GetArtikli();
  }
  </code></pre>
  
  <p>Implementation of <code>[ServiceContract]</code> :</p>
  
  <pre><code>public class Service : IService
  {
      public IEnumerable&lt;Artikal&gt; GetArtikli()
      {
          using (var context = new CijenolomciEntities())
          {
              var result = context.Artikals.ToList();
              result.ForEach(a =&gt; context.Detach(a));
              return result;
          }
  
      }
  }
  </code></pre>
  
  <p>The whole thing is hosted on local IIS. I use Fiddler, an what it says when i try to reach</p>
  
  <pre><code>http://localhost:17916/Service.svc/Artikli 
  </code></pre>
  
  <p>is</p>
  
  <p><code>[Fiddler] ReadResponse() failed: The server did not return a response for this request.</code></p>
  
  <p>The WCF App.Config looks like:</p>
  
  <pre><code>    &lt;?xml version="1.0"?&gt;
      &lt;configuration&gt;
          &lt;connectionStrings&gt;
              &lt;add name="CijenolomciEntities" connectionString="My_Connection_String" providerName="System.Data.EntityClient" /&gt;
          &lt;/connectionStrings&gt;
  
          &lt;system.web&gt;
          &lt;compilation debug="true" targetFramework="4.0" /&gt;
          &lt;/system.web&gt;
  
          &lt;system.serviceModel&gt;
              &lt;protocolMapping&gt;
                  &lt;add scheme="http" binding="webHttpBinding" /&gt;
              &lt;/protocolMapping&gt;
              &lt;behaviors&gt;
                  &lt;endpointBehaviors&gt;
                      &lt;behavior&gt;
                          &lt;webHttp /&gt;
                      &lt;/behavior&gt;
                  &lt;/endpointBehaviors&gt;
              &lt;serviceBehaviors&gt;
              &lt;behavior&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;
          &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><strong>EDIT:</strong>
  When i try to access URL through browser i get the following:</p>
  
  <pre><code>Request Error
  
  The server encountered an error processing the request. See server logs for more details.
  </code></pre>