[英]Getting the error Client found response content type of 'text/html; charset=utf-8', but expected 'application/soap+xml'?
in my local machine I turned On IIS, created virtual directories, built the code and tried to launch the web page, but I am getting the following error -- 在我的本地计算机上,我打开了IIS,创建了虚拟目录,构建了代码并尝试启动网页,但是出现以下错误-
"System.InvalidOperationException: Client found response content type of 'text/html; charset=utf-8', but expected 'application/soap+xml'" “ System.InvalidOperationException:客户端发现响应内容类型为'text / html; charset = utf-8',但预期为'application / soap + xml'”
Can anyone kindly let me know how to rectify this. 谁能让我知道如何纠正这个问题。 Platform used is Windows 7, working with Visual studio 2005, C#.NET. 使用的平台是Windows 7,可与Visual Studio 2005,C#.NET一起使用。 I am new to this, had never worked on these. 我对此并不陌生,从未从事过这些工作。
Kindly help me. 请帮助我。 Thanks In advance. 提前致谢。
It's seems you are working with SOAP1.1 (that use de content type text/xml ) instead of SOAP1.2 (that use conte type application/soap+xml). 似乎您正在使用SOAP1.1(使用de内容类型text / xml)而不是SOAP1.2(使用conte类型的application / soap + xml)。
In your web.config add this: 在您的web.config中添加以下内容:
<system.web>
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpSoap12"/>
</protocols>
</webServices>
</system.web>
It makes your web service accept SOAP1.1 and SOAP1.2 request. 它使您的Web服务接受SOAP1.1和SOAP1.2请求。
If your are working on the client part, you must activate SOAP1.2 protocol for your client application. 如果您在客户端部分上工作,则必须为客户端应用程序激活SOAP1.2协议。 Can't say anymore without code and explanations. 没有代码和解释就不能说了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.