WCF& Soap 在正文中返回 --uuid:{value}?
我正在发出一个肥皂请求,该请求返回以下内容:
HTTP/1.1 200 OK
Content-Length: 7048
Content-Type: multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:dc2ee0dc-fd91-40ef-949d-2c1b02108e23+id=4";start-info="text/xml"
Server: Microsoft-HTTPAPI/2.0
MIME-Version: 1.0
Date: Tue, 25 Oct 2011 12:56:17 GMT
--uuid:dc2ee0dc-fd91-40ef-949d-2c1b02108e23+id=4
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
<s:Envelope details />
一切都很好,除了该部分
--uuid:dc2ee0dc-fd91-40ef-949d-2c1b02108e23+id=4
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
被视为正文的一部分,它会抛出 xml 解析。我想知道这个 uuid 信息 id 是什么以及为什么它作为正文而不是标头的一部分出现? (以及内容 ID、内容传输编码和内容类型?)
I am making a soap request which is returning the following:
HTTP/1.1 200 OK
Content-Length: 7048
Content-Type: multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:dc2ee0dc-fd91-40ef-949d-2c1b02108e23+id=4";start-info="text/xml"
Server: Microsoft-HTTPAPI/2.0
MIME-Version: 1.0
Date: Tue, 25 Oct 2011 12:56:17 GMT
--uuid:dc2ee0dc-fd91-40ef-949d-2c1b02108e23+id=4
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
<s:Envelope details />
Everything is good except that the section
--uuid:dc2ee0dc-fd91-40ef-949d-2c1b02108e23+id=4
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Is being considered part of the body which it throwing off xml parsing. I'm wondering what this uuid information id and why is it coming down as part of the body rather than the header? (Along with the content-id, content-transfer-encoding and content-type?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 Ladislav Mrnka 的 MTOM 评论得出的结论。在我的 app.config 中,我更改为:
这
对于运行 ksoap2 的任何人都很重要,因为它不会处理 mtom 消息,并且会抛出 xml 解析异常。
Figured it out based on
Ladislav Mrnka
s MTOM comment. In my app.config I changed:To
This is important for anyone running ksoap2 as it will not process the mtom message and will throw an xml parsing exception.
如果使用 SOAP UI 客户端来运行 SOAP 请求,请将 TestRequest 属性:内联响应附件设置为“false”。这将修复附加在 SOAP 响应中的 uuid。
[注意:TestRequest 属性对于测试套件中的每个测试步骤都是唯一的。]
If SOAP UI client is used for running the SOAP request, set the TestRequest Properties: Inline Response Attachments to "false". This will fix the uuid being appended in the SOAP response.
[Note :The TestRequest Properties is unique to every Test step in a Test Suite.]