The remote server returned an error: (415) Cannot process the message because the content type 'text

同事将好的 网站和wcf服务布置到目标服务器上,报错如下:

The remote server returned an error: (415) Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'..
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

 

这个错误报的是(415)不能处理的消息格式,因为客户端发送过去的是'text/xml; charset=utf-8' , 而系统期望的是'application/soap+xml; charset=utf-8'。 这个错误初步判断是因为双方通信协议不一致造成的, 查找客户端的We.bConfig中发现 果然同事在布置调试的时候,将endpoint中的binding 改错了, 将wsHttpBinding 改成了basicHttpBinding, 导致双方消息格式编码不一致。

 

正确的

<endpoint address="http://196.9.200.129:8008/Service" binding="wsHttpBinding"
    bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService"
    name="WSHttpBinding_IService1">


 

:

错误的

 

<endpoint address="http://196.9.200.129::8083/Service.svc" binding="basicHttpBinding"
    bindingConfiguration="BasicHttpBinding_IService" contract="ServiceReference1.IService"
    name="BasicHttpBinding_IService" >


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值