【问题标题】:axis2 mtom mime boundaryaxis2 mtom mime 边界
【发布时间】:2012-09-07 04:55:09
【问题描述】:

我有一个使用 ADB 绑定创建的axis2 客户端。 此axis2 客户端与WCF Web 服务通信,以MTOM 模式向其发送XML 附件。 生成的 SOAP 请求是:

POST http://xyz/mtom HTTP/1.1
MIME-Version: 1.0
Content-Type: multipart/related;
type="application/xop+xml";
start="<http://tempuri.org/0>";
boundary="uuid:0daa5c61-46d2-4fe1-9944-097b897367b4+id=1";
start-info="application/soap+xml"; 
action="http://blahblah/SendData"
Host: myserver.org
Content-Length: 22648
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

--uuid:0daa5c61-46d2-4fe1-9944-097b897367b4+id=1
 Content-ID: <http://tempuri.org/0>

如何将 Content-Transfer-Encoding: binary( 下面) 设置为 Content-Transfer-Encoding: 8bit?

 Content-Transfer-Encoding: binary
 Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"

 <s:Envelope><s:Body><SendData>...</SendData></s:Body></s:Envelope>
 --uuid:0daa5c61-46d2-4fe1-9944-097b897367b4+id=1
 Content-ID: <http://tempuri.org/1/634789954872318389>
 Content-Transfer-Encoding: binary
 Content-Type: application/octet-stream

 Serialized payload here
 --uuid:0daa5c61-46d2-4fe1-9944-097b897367b4+id=1--

另外,我猜一个 mime_boundary 用于主肥皂信封,第二个 mime_boundary 用于附件

【问题讨论】:

    标签: android soap axis2 mime mtom


    【解决方案1】:

    不,这是不可能的,这是有充分理由的。 8bit编码定义如下:

    每行最多 998 个八位字节,CR 和 LF(代码分别为 13 和 10)只允许作为 CRLF 行结尾的一部分出现。

    这意味着有些消息无法编码为8bit。 Axis2 必须在开始编写消息之前检查消息是否可以编码为8bit。这将引入不必要的开销。因此,Axis2 仅支持binarybase64,因为它们允许对任何消息进行编码(并且预计它们会被任何 SOAP 堆栈支持)。

    无论如何,你为什么要它使用8bit

    【讨论】:

    • 感谢您的回复。我不得不使用 8 位编码,因为 WCF 网络服务实际上需要它。
    • 另外,我确实在少数论坛中看到了对 8 位编码的引用。所以,这让我一直在寻找。 issues.apache.org/jira/browse/AXIS2-2236
    猜你喜欢
    • 1970-01-01
    • 2015-09-26
    • 2011-04-21
    • 2014-06-19
    • 2013-06-09
    • 2014-12-08
    • 2016-11-29
    • 1970-01-01
    • 2011-08-31
    相关资源
    最近更新 更多