title: Strange WCF Error - IIS hosted - context being aborted
body: <p>I have a WCF service that does some document conversions and returns the document to the caller. When developing locally on my local dev server, the service is hosted on ASP.NET  Development server, a console application invokes the operation and executes within seconds.</p>
  
  <p>When I host the service in IIS via a .svc file, two of the documents work correctly, the third one bombs out, it begins to construct the word document using the OpenXml Sdk, but then just dies. I think this has something to do with IIS, but I cannot put my finger on it.</p>
  
  <p>There are a total of three types of documents I generate. In a nutshell this is how it works</p>
  
  <p>SQL 2005 DB/IBM DB2 -> WCF Service written by other developer to expose data. This service only has one endpoint using basicHttpBinding</p>
  
  <p>My Service invokes his service, gets the relevant data, uses the Open Xml Sdk to generate a Microsoft Word Document, saves it on a server and returns the path to the user.</p>
  
  <p>The word documents are no bigger than 100KB.</p>
  
  <p>I am also using basicHttpBinding although I have tried wsHttpBinding with the same results.</p>
  
  <p>What is amazing is how fast it is locally, and even more that two of the documents generate just fine, its the third document type that refuses to work.</p>
  
  <p><strong>To the error message:</strong></p>
  
  <p>An error occured while receiving the HTTP Response to <a href="http://myservername.mydomain.inc/MyService/Service.Svc" rel="nofollow noreferrer">http://myservername.mydomain.inc/MyService/Service.Svc</a>. This could be due to the service endpoint binding not using the HTTP Protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the server shutting down). See server logs for more details.</p>
  
  <p>I have spent the last 2 days trying to figure out what is going on, I have tried everything, including changing the maxReceivedMessageSize, maxBufferSize, maxBufferPoolSize, etc etc to large values, I even included:</p>
  
  <pre><code> &lt;httpRuntime maxRequestLength="2097151" executionTimeout="120"/&gt;
  </code></pre>
  
  <p>To see maybe if IIS was choking because of that.</p>
  
  <p>Programatically the service does nothing special, it just constructs the word documents from the data using the Open Xml Sdk and like I said, locally all 3 documents work when invoked via a console app running locally on the asp.net dev server, i.e. <a href="http://localhost:3332/myService.svc" rel="nofollow noreferrer">http://localhost:3332/myService.svc</a></p>
  
  <p>When I host it on IIS and I try to get a Windows Forms application to invoke it, I get the error.</p>
  
  <p>I know you will ask for logs, so yes I have logging enabled on my Host.</p>
  
  <p>And there is <strong>no error in the logs</strong>, I am logging everything.</p>
  
  <p>Basically I invoke two service operations written by another developer.</p>
  
  <p>MyOperation calls -> HisOperation1 and then HisOperation2, both of those calls give me complex types. I am going to look at his code tomorrow, because he is using LINQ2SQL and there may be some funny business going on there. He is using a variety of collections etc, but the fact that I can run the exact same document, lets call it "Document 3" within seconds when the service is being hosted locally on ASP WebDev Server is what is most odd, why would it run on scaled down Cassini and blow up on IIS?</p>
  
  <p>From the log it seems, after calling HisOperation1 and HisOperation2 the service just goes into la-la land dies, there is a application pool (w3wp.exe) error in the Windows Event Log.</p>
  
  <pre><code>Faulting application w3wp.exe, version 6.0.3790.1830, stamp 42435be1, faulting module kernel32.dll, version 5.2.3790.3311, stamp 49c5225e, debug? 0, fault address 0x00015dfa.
  </code></pre>
  
  <p>It's classified as .NET 2.0 Runtime error.</p>
  
  <p>Any help is appreciated, the lack of sleep is getting to me.</p>
  
  <p>Help me Obi-Wan Kenobi, you're my only hope.</p>