2012-09-14 35 views
0

我有一个使用ADB绑定创建的axis2客户端。 这个axis2客户端与一个WCF web服务对话,以MTOM模式发送一个XML附件。 产生的SOAP请求是:axis2 mtom mime边界

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> 

如何使内容传输编码:二进制(下同)内容传输编码:8位?

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是主要的SOAP信封和第二mime_boundary是附件

回答

1

不,这是不可能的,并有一个很好的理由。所述8bit编码定义如下:每行

最多998个八位位组与只允许显示为结束一个CRLF线的一部分CR和LF(码分别为13和10)。

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

反正你为什么要用它8bit

+0

感谢您的回复。我不得不使用8位编码,因为WCF Web服务实际上期望它。 –

+0

另外,我在几个论坛上看到了对8位编码的引用。所以,这让我望而生畏。 https://issues.apache.org/jira/browse/AXIS2-2236 –

+0

WCF产生的错误信息是什么? –