Note that there are some explanatory texts on larger screens.

plurals
  1. POAre WCF data streaming restrictions enforced?
    primarykey
    data
    text
    <p>We have been seeing random OutOfMemoryExceptions and InsufficientMemoryExceptions at customer sites. We use the GZipMessageEncoder to compress messages. (I am aware of the <a href="https://stackoverflow.com/questions/4631627/wcf-conditional-compression/7278500#7278500">IIS 7.x compression</a> option and <a href="https://stackoverflow.com/questions/4043683/wcf-httptransport-streamed-vs-buffered-transfermode">other problems with buffering and/or the GZipMessageEncoder</a>.)</p> <p>I wanted to try to enable WCF streaming. Our WCF services have contracts like the following:</p> <pre><code>[OperationContract] DataSet GetDataSet(Guid someGUID, string someName, DataSet parameters); </code></pre> <p>According to <a href="http://msdn.microsoft.com/en-us/library/ms731913.aspx" rel="nofollow noreferrer">this article on MSDN</a>:</p> <blockquote> <p>Operations that occur across a streamed transport can have a contract with at most one input or output parameter</p> </blockquote> <p>Obviously, our contract violates the WCF streaming restrictions. This contract has 3 input parameters.</p> <p>However, out of curiosity, I decied to try enabling streaming anyway. I edited the web.config file and MyCSharpClient.config file and inserted the following attribute into the transport section of the binding:</p> <pre><code>&lt;httpTransport ... transferMode="Streamed"&gt; </code></pre> <p>To my surprise, everything seems to work anyway! There are no exceptions thrown. I can break into the GZipMessageEncoder and verify that the stream methods are being called instead of the buffer methods.</p> <p>So, my question: why was I able to setup streaming transport on an operation context that violates the WCF restriction on input parameters? Given the strong wording of the MSDN streaming article, I assume this is just an implementation detail, and that I must not rely on this behavior.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload