If you want to pass only the response, use transferMode=streamedResponse in your binding configuration. This ensures that only the returned response is transmitted.
The return value of the streaming function must be Stream . Then you can read from this stream and do whatever you need with it (store, analyze, whatever).
So, you have a service contract like this:
[ServiceContract] interface IYourService { [OperationContract] Stream GetData(SmallSizeRequestClass request); }
On the server, you simply write the stream, and on the client you read from the stream.
Have you consulted the MSDN docs on streaming WCF ?
source share