通过WCF发送二进制数据:二进制VS MTOM编码 [英] Send binary data via WCF: binary vs MTOM encoding

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

问题描述

我有限的WCF知识以及通过WCF发送二进制数据,所以这个问题可能有些残留。

I have limited knowledge in WCF as well as sending binary data via WCF, so this question may be somewhat rudimental.

我想知道用 BinaryMessageEncodingBindingElement MtomMessageEncodingBindingElement 发送数据之间的差异。它目前还不清楚,我当上阅读从MSDN此页之后使用的方法大数据和流

I would like to know the difference between sending data with BinaryMessageEncodingBindingElement and MtomMessageEncodingBindingElement. It is still not clear to me when to use which approach after reading this page from MSDN on Large Data and Streaming.

另外,一个小问题:是带有附件的邮件和MTOM消息同样的事情

Also, a small question: are a message with attachments and an MTOM message the same thing?

推荐答案

MTOM是使用多部分MIME-CN codeD消息发送大和过于昂贵为base64消息的部分标准EN code作为纯二进制。 SOAP消息本身被作为消息的最初部分,包含二进制的部分,类似WCF的Web服务软件栈可以再拉回来一起创建邮件的单重presentation引用。

MTOM is a standard that uses multi-part mime-encoded messages to send portions of the message that are large and would be too expensive to base64 encode as pure binary. The SOAP message itself is sent as the initial part of the message and contains references to the binary parts which a web service software stack like WCF can then pull back together to create a single representation of the message.

二进制编码完全是专有的WCF,真的不只是有大的消息有关。它presents XML信息的二进制重新presentation远远跨线更紧凑,速度比基于文本格式的解析。如果你碰巧要发送数据的大型二进制数据块,然后它只是适合权与正在发送的其它字节。

Binary encoding is entirely proprietary to WCF and really doesn't just have to do with large messages. It presents a binary representation of the XML Infoset which is far more compact across the wire and faster to parse than text based formats. If you happen to be sending large binary chunks of data then it just fits right in with the other bytes that are being sent.

流媒体可以做的任何消息格式使用。这更多当数据通过网络写入与被完全缓冲在memoery被psented到网络传输$ P $前约。较小的消息更有意义,发送和较大的消息,特别是含有大量的二进制数据块或数据流,必要被流或将耗尽内存资源之前缓冲了。

Streaming can be done used with any message format. That's more about when the data is written across the network vs. being buffered entirely in memoery before being presented to the network transport. Smaller messages make more sense to buffer up before sending and larger messages, especially those containing large binary chunks or streams, necessitate being streamed or will exhaust memory resources.

这篇关于通过WCF发送二进制数据:二进制VS MTOM编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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