简体   繁体   English

收到错误消息,客户端发现响应内容类型为'text / html; charset = utf-8”,但预期为“ application / soap + xml”?

[英]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.

相关问题 wcf +响应消息的内容类型text / html与绑定的内容类型不匹配(application / soap + xml; charset = utf-8) - 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) WCF错误:(415)内容类型&#39;application / x-www-form-urlencoded&#39;不是预期类型&#39;application / soap + xml; 字符集= UTF-8&#39; - WCF ERROR: (415) content type 'application/x-www-form-urlencoded' was not the expected type 'application/soap+xml; charset=utf-8' WCF成员资格提供程序引发错误:内容类型&#39;application / json; charset = utf-8&#39;不是预期的类型&#39;application / soap + xml; 字符集= UTF-8&#39; - WCF Membership Provider throws error: content type 'application/json; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8' SILVERLIGHT WCF问题:内容类型application / soap + xml; charset = utf-8已发送到需要text / xml的服务; - SILVERLIGHT WCF Issue: Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; 无法处理该消息,因为内容类型“ application / xml”不是预期的类型“ application / soap + xml”; 字符集= utf-8&#39; - Cannot process the message because the content type 'application / xml' was not the expected type 'application / soap + xml; charset = utf-8 ' 响应消息的内容类型application / xml; charset = utf-8与绑定的内容类型不匹配(text / xml; charset = utf-8) - The content type application/xml;charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8) 响应消息的内容类型 application/xml;charset=utf-8 与绑定的内容类型(text/xml; charset=utf-8)不匹配,WCF - The content type application/xml;charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8), WCF 内容类型text / html; charset =响应消息的UTF-8与绑定的内容类型不匹配(text / xml; charset = utf-8) - 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) HTTP 415 无法处理消息,因为内容类型为“application/json; charset=utf-8&#39; 不是预期的类型 &#39;text/xml; 字符集=utf-8&#39; - HTTP 415 Cannot process the message because the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8' 无法处理消息,因为内容类型为 &#39;application/json; charset=utf-8&#39; 不是预期的类型 &#39;text/xml; 字符集=utf-8&#39; - Cannot process the message because the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM