[英]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跟踪:
Edit WCF Configuration
Edit WCF Configuration
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 Flush
, MessageLogging
和Tracing
,当然指定您的主机的身份访问写的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.