I have a WCF service that needs to read large (10 to 20 million) numbers of objects from the database.
What I\'d like to do, is have the client open up a stream and ha
How about instead of setting up a streaming/blocking service you use something like WS Dual Http. With it you have an async bidirectional callback channel that allows you to request/reply information back and forth between the server and the client. Issues you may see if you want to stream the entire set is a normal fashion is that some of the resources may block other requests (or timeout) while other users try to access the service.
The problem is that WCF does not provide response stream to operation. The stream returned from operation is just a "content" of some message. I tryed to trick WCF with some threading scenarios where I returned MemoryStream and tryed to fill it from other thread but as expected it didn't work.
Mentioned HttpHandler is the only way to go.
You might want to take a look at the PollingDuplexHttpBinding (notice id did may might :-)).
Some aren't very fond of this binding but I haven't had too much trouble with it after the initial hurdle of getting the config right.
It could certainly do the job I think since it's little more than the 'long polling trick' used in web-sockets as I understand.
HTH.