无法在WCF中使用MTOM

时间:2016-02-03 19:14:05

标签: java c# web-services wcf wcf-binding

在我的.NET应用程序中,我必须使用用java编写的WS来传输附件。

我已尝试在互联网上找到的所有示例和建议都没有成功。

来自WS的响应消息(使用Fiddler捕获)是

mapPartitionsWithIndex

和WCF说“创建MTOM阅读器时出错”,“MTOM消息必须是'application / xop + xml'类型。”

在我的Web.config中,我有以下配置

HTTP/1.1 200 OK
X-Backside-Transport: OK OK
Connection: Keep-Alive
Date: Wed, 03 Feb 2016 18:24:29 GMT
Content-Type: multipart/related; boundary="MIMEBoundaryurn_uuid_BA16316AD1D3F515FC1454523870165"; start-info="text/xml"; type="text/xml"; start="<0.urn:uuid:BA16316AD1D3F515FC1454523870166@apache.org>"
Content-Language: it-IT
X-Client-IP: 192.168.15.175
X-Global-Transaction-ID: 136856193
Content-Length: 1699001



--MIMEBoundaryurn_uuid_BA16316AD1D3F515FC1454523870165
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:BA16316AD1D3F515FC1454523870166@apache.org>

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://MyServer/WS/ReadAttachement</wsa:Action><wsa:RelatesTo>da543ac1-f44a-4e9b-a319-0712790a8c78</wsa:RelatesTo></soapenv:Header><soapenv:Body><ns2:ReadAttachement xmlns:ns2="http://MyServer/WS/"><binary><idDoc>204511</idDoc><idRequest>NNNNN</idRequest><AccessCode>XXXXX</AccessCode><file><xop:Include href="cid:urn:uuid:BA16316AD1D3F515FC1454523870167@apache.org" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></file></binary><message><code>1</code><description>Request OK</description></message></ns2:ReadAttachement></soapenv:Body></soapenv:Envelope>
--MIMEBoundaryurn_uuid_BA16316AD1D3F515FC1454523870165
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:BA16316AD1D3F515FC1454523870167@apache.org>

... binary content

--MIMEBoundaryurn_uuid_BA16316AD1D3F515FC1454523870165--

由于

0 个答案:

没有答案