使用WCF提供大型报表数据集
我需要一个应用程序来访问远程数据库的报告数据。我们当前有一个 WCF 服务来处理该数据库的 I/O。通常,应用程序只是在 WCF 服务与其自身之间来回发送小消息,但现在我们需要运行一些有关该活动的历史报告。结果可能是数百到数千条记录。我遇到了 http://msdn.microsoft.com/en-us/library/ ms733742.aspx 其中讨论了流式传输,但它也提到了分段消息,我没有找到更多相关信息。从 WCF 服务发送大量数据的最佳方法是什么?
I have a need for an application to access reporting data from a remote database. We currently have a WCF service that handles the I/O for this database. Normally the application just sends small messages back and forth between the WCF service and itself, but now we need to run some historical reports on that activity. The result could be several hundred to a few thousand records. I came across http://msdn.microsoft.com/en-us/library/ms733742.aspx which talks about streaming, but it also mentions segmenting messages, which I didn't find any more information on. What is the best way to send large amounts of data such as this from a WCF service?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来我的选择是流式传输或分块。流式传输限制其他 WCF 功能,消息安全性就是其中之一 (http://msdn.microsoft.com/en-us/library/ms733742.aspx)。分块是将消息分解成多个片段,然后在客户端将这些片段重新组合在一起。这可以通过实现自定义通道来完成,MS 在这里提供了一个示例:http ://msdn.microsoft.com/en-us/library/aa717050.aspx。这是在安全层下方实现的,因此仍然可以使用安全性。
It seems my options are streaming or chunking. Streaming restricts other WCF features, message security being one (http://msdn.microsoft.com/en-us/library/ms733742.aspx). Chunking is breaking up a message into pieces then putting those pieces back together at the client. This can be done by implementing a custom Channel which MS has provided an example of here: http://msdn.microsoft.com/en-us/library/aa717050.aspx. This is implemented below the security layer so security can still be used.