MTOM 是如何工作的? [英] How does MTOM work?

查看:35
本文介绍了MTOM 是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MTOM 是 W3C 消息传输优化机制,一种高效地向 Web 服务发送二进制数据和从 Web 服务发送二进制数据的方法.

MTOM is the W3C Message Transmission Optimization Mechanism, a method of efficiently sending binary data to and from web services.

它一般是如何工作的?

推荐答案

如果你把 Wireshark(或启用System.Net Logging) 在未启用 MTOM 的情况下服务,您应该会看到带有二进制数据编码为 BASE64 的 SOAP 请求.将其作为 BASE64 发送会增加二进制数据的大小,但(我假设)使其更具互操作性.

If you put Wireshark (or enabled System.Net Logging) on the non-MTOM enabled service, you should see the SOAP requests with the binary data encoded as BASE64. Sending it as BASE64 increases the size of the binary data but (I assume) makes it more interoperable.

使用 MTOM,SOAP 消息作为 MIME 消息发送,BASE64 编码被替换为占位符.然后将二进制数据放置在定界符之间(每段二进制数据都会发生这种情况),然后放置在 SOAP 请求的末尾.然后以未编码的方式发送二进制数据.IIRC,MTOM 还确定将其作为 MIME 消息发送是否会增加 SOAP 调用的大小,如果不提供保存,则将其作为普通 SOAP 消息发送.

With MTOM, the SOAP messages are sent as MIME messages with the BASE64 encoding being replaced with a placeholder. The binary data is then placed between delimiters (which happens for each piece of binary data), and then placed at the end of the SOAP request. The binary data is then sent unencoded. IIRC, MTOM also determines whether sending it as a MIME message will increase the size of the SOAP call and if doesn't provide a saving, it will send it as a normal SOAP message.

提供了一个示例通过线路发送的消息看起来像.

This provides an example of what the message sent over the wire looks like.

这篇关于MTOM 是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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