We have been seeing random OutOfMemoryExceptions and InsufficientMemoryExceptions at customer sites. We use the GZipMessageEncoder to compress messages. (I am aware of the IIS 7.x compression option and other problems with buffering and/or the GZipMessageEncoder.)
I wanted to try to enable WCF streaming. Our WCF services have contracts like the following:
[OperationContract]
DataSet GetDataSet(Guid someGUID, string someName, DataSet parameters);
According to this article on MSDN:
Operations that occur across a streamed transport can have a contract with at most one input or output parameter
Obviously, our contract violates the WCF streaming restrictions. This contract has 3 input parameters.
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:
<httpTransport ... transferMode="Streamed">
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.
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.