WCF发送大量数据 [英] WCF sending huge data

查看:95
本文介绍了WCF发送大量数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向WCF服务发送大量数据. 数据可能包含数千个od记录(实体),具体取决于所解析的输入文件.

I want to send a huge set of data to a WCF service. The data might consist of thousands od records (entities), depending on the parsed input file.

现在的问题是:发送这些数据的最佳方式是什么?

Now the question is: what is the most optimal way to send these data?

a.逐条记录吗?

通过这种方式,我将确保我不会超出允许的最大邮件大小,并且可以在las成功发送实体的位置处从网络问题中恢复,但是另一方面,会产生很多相关的开销连接到同一服务数千次,并随每条记录传输SOAP标头(这确实是很大的开销).

By this I will be sure that I won't exceed the maximum allowed message size and I can recover from a network problem at the position of las successfully send entity, but on the other hand there will be A LOT of overhead related to connecting to the same service thousands of times and transmit with each record the SOAP headers (really big overhead).

b.一次全部?

这将为我节省一些开销,但是,另一方面,如果邮件大小达到500 MB或2 GB,我将阻止计算机,我将超出最大邮件配额 假设在上传500 MB中的490 MB后发生了网络连接,那么我必须重新发送490 MB.

This will save me some overhead, but on the other hand, if the message size will reach let's say 500 MB or 2 GB, I will block the machine, I will exceed the maximum message quota and let's say that after uploading 490 MB out of 500 MB a network connection occurred, then I have to re-send the 490 MB.

c.零件?

我的意思是部分发送数据.我将在每100条记录后拆分数据,然后将它们分段上传.节省一些开销.

By this I mean sending the data but in part. I'll split the data after each 100 records and upload them part by part. Some savings on the overhead.

有没有更好的方法来执行此操作? 有任何想法吗? 哪一个是最佳的?

Is there any better way to perform this? Any ideas? Which one is the most optimal one?

谢谢.

推荐答案

WCF支持流传输,以允许大型文件以高性能的方式与服务端点之间进行传输.有关更多信息,请查看此文章信息.

WCF supports streaming to allow large files to be transferred to/from a service endpoint in a performant fashion. Check out this article for more information.

这篇关于WCF发送大量数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆