WCF chunk data with stream

送分小仙女□ 提交于 2019-12-07 13:20:16

问题


HI, I neet to pass chunk data from WCF service to client. I have a table with 16 million records, and so, when the client requests data from that table i open a datareader to that table and serialize and send every record to client,here is my method signature..

public AsyncResult FindAsync(AsyncRequest request)

where AsyncResult and AsyncRequest are MessageContract, and AsyncResult has a stream in it. the problem is that when a client call the metod my function does not returns untill all data is not writed in stream in server... is it possible to change this behavior or I have to use callbacks?


回答1:


Yes, you can do a streaming transfer. Check out the "streaming" example at idesign.net. I believe it shows an example of what you want to do.




回答2:


I found great solution here http://weblogs.asp.net/cibrax/archive/2008/06/10/streaming-large-content-with-wcf-and-deferred-execution.aspx#6288340



来源:https://stackoverflow.com/questions/853448/wcf-chunk-data-with-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!