![](/img/trans.png)
[英]wcf + The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8)
[英]Getting the error Client found response content type of 'text/html; charset=utf-8', but expected 'application/soap+xml'?
在我的本地计算机上,我打开了IIS,创建了虚拟目录,构建了代码并尝试启动网页,但是出现以下错误-
“ System.InvalidOperationException:客户端发现响应内容类型为'text / html; charset = utf-8',但预期为'application / soap + xml'”
谁能让我知道如何纠正这个问题。 使用的平台是Windows 7,可与Visual Studio 2005,C#.NET一起使用。 我对此并不陌生,从未从事过这些工作。
请帮助我。 提前致谢。
似乎您正在使用SOAP1.1(使用de内容类型text / xml)而不是SOAP1.2(使用conte类型的application / soap + xml)。
在您的web.config中添加以下内容:
<system.web>
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpSoap12"/>
</protocols>
</webServices>
</system.web>
它使您的Web服务接受SOAP1.1和SOAP1.2请求。
如果您在客户端部分上工作,则必须为客户端应用程序激活SOAP1.2协议。 没有代码和解释就不能说了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.