Search code examples
wcfstreaminglarge-data

How do I use streaming with WCF services returning a large data set?


I'm fairly new to WCF and I'm trying to figure out how streaming works.I basically have a web service that is supposed to return some information from a db.The data returned is potentially very large.I was wondering if anyone could point out a good example of how is this done.If I'm understanding things correctly, my web service method should be returning a stream object.But how do I actually pass data to the stream? Is it just a matter of serializing each object and writing it to the stream? If so, how exactly would the serializaition be done? Once again, a simple example would be very much appreciated.


Solution

  • You should just set the Binding's TransferMode property to the Streamed value and work with your WCF services as you would do. The WCF infrastructure will do all the job automatically.

    Here is one more useful link:

    Streaming Message Transfer