WCF服务给出了远程服务器返回的错误:(415)由于内容类型为'application/soap + xml,因此无法处理该消息; charset = utf-8'不是预期的类型'text/xml; charset = utf-8'. [英] WCF service gives The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..

查看:647
本文介绍了WCF服务给出了远程服务器返回的错误:(415)由于内容类型为'application/soap + xml,因此无法处理该消息; charset = utf-8'不是预期的类型'text/xml; charset = utf-8'.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我添加对使用IIS7托管在我的计算机中的WCF服务的引用时,出现以下错误.但是我可以使用Visual Studio中的WCF服务.在将服务引用添加到项目的过程中会弹出该错误.在那儿 是否需要在IIS中的Mime类型中添加任何内容?

When I add reference to a WCF service which is hosted in my machine with IIS7, i am getting the following error. But I can consume the WCF service from Visual Studio. The error is popped up during addidng the Service Reference to the Project. Is there anything need to be added to the Mime Types in IIS?

元数据包含无法解析的引用:'http://192.168.0.15:85/SampleApplication/MediaService.svc?wsdl'.
WSDL文档包含无法解析的链接.下载'http://192.168.0.15:85/SampleApplication/MediaService.svc?xsd=xsd0'时出错.
基础连接已关闭:接收时发生意外错误.
无法从传输连接中读取数据:远程主机强行关闭了现有连接.
远程主机强行关闭了现有连接.元数据包含无法解析的引用:'http://192.168.0.15:85/SampleApplication/MediaService.svc'.服务不支持charset = utf-8 http://http://192.168.0.15:85/SampleApplication/MediaService.svc .客户端和服务的绑定可能不匹配.远程服务器返回错误:(415)无法处理消息,因为内容类型为'application/soap + xml; charset = utf-8' 不是预期的类型'text/xml; charset = utf-8'..

Metadata contains a reference that cannot be resolved: 'http://192.168.0.15:85/SampleApplication/MediaService.svc?wsdl'.
The WSDL document contains links that could not be resolved.There was an error downloading 'http://192.168.0.15:85/SampleApplication/MediaService.svc?xsd=xsd0'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote hostMetadata contains a reference that cannot be resolved: 'http://192.168.0.15:85/SampleApplication/MediaService.svc'.Content Type application/soap+xml; charset=utf-8 was not supported by service http://http://192.168.0.15:85/SampleApplication/MediaService.svc.  The client and service bindings may be mismatched.The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..

请帮助.

谢谢

Vince

推荐答案

但是我可以使用Visual Studio中的WCF服务

But I can consume the WCF service from Visual Studio


您可以从VS使用服务但不添加对它的引用是什么意思呢?下一个问题.您是否正在使用REST服务?请发布我们的服务和客户端的绑定配置.绑定之间可能不匹配.


What exactly do you mean by you can consume your service from VS but not add a reference to it? Next question.Are you using a REST service? Please post the binding config of our service and client. There might be a mismatch between the bindings.


这篇关于WCF服务给出了远程服务器返回的错误:(415)由于内容类型为'application/soap + xml,因此无法处理该消息; charset = utf-8'不是预期的类型'text/xml; charset = utf-8'.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆