WCF 服务的协议异常
当我尝试访问 WCF 客户端时,出现以下错误。我能够使用 IE 访问我的服务,并能够在 VS 2010 中进行引用。我的开发环境是 Windows Server 2008。我在 Sharepoint Project 服务器中托管服务。我被这个错误困住了。请指教。
“响应消息的内容类型 text/html; charset=UTF-8 与绑定的内容类型 (text/xml; charset=utf-8) 不匹配。如果使用自定义编码器,请确保 IsContentTypeSupported 方法已正确实现。”
这是来自 Fiddler 的一些数据标头。
获取 /_vti_bin/psi/helloservice.svc HTTP/1.1 内容类型:text/xml;字符集 = utf-8
MicrosoftSharePointTeamServices:14.0.0.4762 服务器:微软-IIS/7.5 X-AspNet-版本:2.0.50727 X-SharePointHealth评分:4
When I try to access WCF client, I get the following error. I was able to access my service using IE and able to reference in VS 2010. My development environment is Windows server 2008. I hosted service in Sharepoint Project server. I am stuck with this error. Please advice.
"The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. "
Here is some data Headers from Fiddler.
GET /_vti_bin/psi/helloservice.svc HTTP/1.1
Content-Type: text/xml; charset=utf-8
MicrosoftSharePointTeamServices: 14.0.0.4762
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-SharePointHealthScore: 4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
必须在服务器上启用 WCF HTTP 激活。如果未安装 WCF 的脚本映射,您可能会收到错误消息。
WCF HTTP Activation must be enabled on the server. If the script maps for WCF are not installed you may receive the error.