title: WCF service returns HTTP 200 header and then times out without returning any content
body: <p>I have a Silverlight 4 user control that calls a WCF service residing within an ASP.NET 4 web application. </p>
  
  <p>Anonymous access to the webservice is enabled. clientaccesspolicy.xml is in place and downloads successfully. Navigating to FieldITDbService.svc on the server correctly pulls up the service metadata.</p>
  
  <p>However, when I try to view the test page for the Silverlight control that calls this WCF service, the service itself returns:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Thu, 22 Jul 2010 21:15:54 GMT
  Server: Microsoft-IIS/6.0
  X-Powered-By: ASP.NET
  X-AspNet-Version: 4.0.30319
  Content-Encoding: gzip
  Content-Length: 4409
  Cache-Control: private
  Content-Type: application/soap+msbin1
  </code></pre>
  
  <p>and then <strong>times out without returning data</strong>. I am baffled. Does anyone know why this would happen or how I can more effectively debug it? I am trace logging the service but there are no errors in the log -- according to the log, it's working.</p>
  
  <p>Here's a link showing what happens (from Fiddler2): <a href="https://imgur.com/VwgqS.png" rel="nofollow noreferrer">http://imgur.com/VwgqS.png</a></p>
  
  <p>Here is the code in MainPage.xaml.cs that calls the webservice:</p>
  
  <pre><code>var webService = new FieldITDbServiceClient();
  webService.ReadVAMDataCompleted += webService_ReadVAMDataCompleted;
  webService.ReadVAMDataAsync();
  webService.CloseAsync();
  </code></pre>
  
  <p>Here is the ClientConfig in the Silverlight project used to call the webservice:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;customBinding&gt;
              &lt;binding name="CustomBinding_FieldITDbService"&gt;
                  &lt;binaryMessageEncoding /&gt;
                  &lt;httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /&gt;
              &lt;/binding&gt;
          &lt;/customBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
          &lt;endpoint address="http://[ipofmyserverhere]/FieldIT/FieldITDBService.svc"
              binding="customBinding" bindingConfiguration="CustomBinding_FieldITDbService"
              contract="DbServiceRef.FieldITDbService" name="CustomBinding_FieldITDbService" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Here is the code in the actual WCF service, FieldITDbService.svc:</p>
  
  <pre><code> [ServiceContract( Namespace = "" )]
      [AspNetCompatibilityRequirements( RequirementsMode = AspNetCompatibilityRequirementsMode.Required )]
      public class FieldITDbService
      {
          [OperationContract]
          public List&lt;VAM&gt; ReadVAMData()
          {
              List&lt;VAM&gt; allData = new List&lt;VAM&gt;();
              using( FieldITEntities dbContext = new FieldITEntities() )
              {
                  allData.AddRange( dbContext.VAMs.ToList() );
              }
              return allData;
          }
      }
  </code></pre>
  
  <p>Here is the serviceModel section in the web apps web.config file:</p>
  
  <pre><code> &lt;system.serviceModel&gt;
      &lt;diagnostics&gt;
        &lt;messageLogging maxMessagesToLog="100"
            logEntireMessage="true"
            logMessagesAtServiceLevel="true"
            logMalformedMessages="true"
            logMessagesAtTransportLevel="true"&gt;
        &lt;/messageLogging&gt;
      &lt;/diagnostics&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name=""&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;customBinding&gt;
          &lt;binding name="FieldIT.FieldITDbService.customBinding0"&gt;
            &lt;binaryMessageEncoding /&gt;
            &lt;httpTransport /&gt;
          &lt;/binding&gt;
        &lt;/customBinding&gt;
      &lt;/bindings&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"
        multipleSiteBindingsEnabled="true" /&gt;
      &lt;services&gt;
        &lt;service name="FieldIT.FieldITDbService"&gt;
          &lt;endpoint address="" binding="customBinding" bindingConfiguration="FieldIT.FieldITDbService.customBinding0"
            contract="FieldIT.FieldITDbService" /&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>