今天同事调用一个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>

 

相关文章:

  • 2022-12-23
  • 2021-11-26
  • 2021-05-19
  • 2021-10-06
  • 2022-12-23
  • 2021-04-14
  • 2022-12-23
  • 2021-09-22
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2022-02-18
  • 2021-04-27
  • 2021-12-16
  • 2022-12-23
相关资源
相似解决方案