title: Best practices for streaming response of WCF webservice
body: <p>I'm trying to pull a large amount of data out of a WCF web service.  The request is fairly small and the response message will be very big.  Currently the web service is throwing SystemOutOfMemory exceptions due a limitation on IIS6 for the memory it can allocated (~1.4GB).  </p>
  
  <p>I have read in some blogs that implementing streaming will solve my problem.</p>
  
  <p>Can anybody share their experiences with this topic? I'm most interested in any sample client-side &amp; service-side code that can be shared or any recommendations/best practices.  MemoryStream vs FileStream? Return type should be Stream, Message, Byte[]?  </p>
  
  <p>My operation looks like the following: (typically it will return a big number of elements in the response array, ~200K elements)</p>
  
  <pre><code>MediumSizeResponseClass[] GetData(SmallSizeRequestClass request)
  </code></pre>