简体   繁体   English

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)

I'm facing the below error " The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 514 bytes of the response were" . 我遇到以下错误“ 响应消息的内容类型text / html与绑定的内容类型不匹配(application / soap + xml; charset = utf-8)。如果使用自定义编码器,请确保IsContentTypeSupported方法已正确实现。响应的前514个字节为” below is my bindings and config file 以下是我的绑定和配置文件

  <customBinding>
                <binding name="LoginServiceSoap12Binding">
                    <textMessageEncoding messageVersion="Soap12" />
                    <httpsTransport />
                </binding>
            </customBinding>

<endpoint address="WCF URL"
             binding="customBinding" bindingConfiguration="LoginServiceSoap12Binding"
             contract="CWALoginService.LoginServicePortType" name="LoginServiceHttpsSoap12Endpoint" />

What is issue not sure i'm facing here... 什么是不确定我在这里面临的问题...

It most of the time means that your host returns an error page (because the content type is text/html as stated) instead of your service returning the response in application/soap+xml . 多数情况下,这意味着您的主机返回错误页面(因为内容类型为所述的text/html ),而不是您的服务在application/soap+xml返回响应。

You should check if your service can be activated successfully by going in the url of your service ( http(s)://localhost{:port}/{subSite}/(WCF URL).svc ). 您应该通过输入服务的URL( http(s)://localhost{:port}/{subSite}/(WCF URL).svc )检查服务是否可以成功激活。 If your service can be activated, than the next thing you should try is enabling the wcf tracing in both your client and service side by following: 如果您的服务可以被激活,那么接下来您应该尝试的是通过以下步骤在客户端和服务端启用wcf跟踪:

  • Right click your web.config/app.config and click Edit WCF Configuration 右键单击您的web.config / app.config,然后单击“ Edit WCF Configuration
  • Under Diagnostics section, enable Log Auto Flush , MessageLogging and Tracing and of course specify a path which your host identity has access to write. Diagnostics部分,启用Log Auto FlushMessageLoggingTracing ,当然指定您的主机的身份访问写的路径。
  • Check the trace file after you execute that service call. 执行该服务调用后,请检查跟踪文件。 Then you should see the html returned by your host and figure out what the real problem is. 然后,您应该查看主机返回的html并找出真正的问题是什么。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 响应消息的内容类型 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 响应消息的内容类型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) 内容类型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) 内容类型 text/xml; 响应消息的 charset=&quot;utf-8&quot; 与绑定的内容类型不匹配 (text/xml; charset=utf-8) - The content type text/xml; charset=“utf-8” of the response message does not match the content type of the binding (text/xml; charset=utf-8) 响应消息的内容类型文本/纯文本与绑定的内容类型不匹配(文本/ xml; charset = utf-8) - The content type text/plain of the response message does not match the content type of the binding (text/xml; charset=utf-8) 收到错误消息,客户端发现响应内容类型为&#39;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'? WCF 服务客户端:内容类型text/html; 响应消息的 charset=utf-8 与绑定的内容类型不匹配 - WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding 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; WCF http绑定错误:内容类型text / html与绑定的内容类型不匹配(text / xml; charset = utf-8) - WCF http binding error: The content type text/html does not match the content type of the binding (text/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'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM