您的位置:首页 > 移动开发

webservice有关application/xop+xml的异常

2017-07-07 09:05 465 查看
今天同事调用一个webservice时返回类似错误

响应消息的内容类型 multipart/related; type="application/xop+xml"; boundary="uuid:026bd32a-6fb3-45a6-8559-fe68024bfe2a"; start="<root.message@cxf.apache.org>"; start-info="text/xml" 与绑定(text/xml; charset=utf-8)的内容类型不匹配。如果使用自定义编码器,请确保正确实现


搜索找到这个地方

http://stackoverflow.com/questions/10496186/error-consuming-webservice-content-type-application-xopxml-does-not-match-ex

原来只需修改配置的编码方式为“Mtom”就能解决问题

<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding messageEncoding="Mtom">
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐