[英]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
[英]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)
我遇到以下错误“ 响应消息的内容类型text / html与绑定的内容类型不匹配(application / soap + xml; charset = utf-8)。如果使用自定义编码器,请确保IsContentTypeSupported方法已正确实现。响应的前514个字节为” 。 以下是我的绑定和配置文件
<customBinding>
<binding name="LoginServiceSoap12Binding">
<textMessageEncoding messageVersion="Soap12" />
<httpsTransport />
</binding>
</customBinding>
<endpoint address="WCF URL"
binding="customBinding" bindingConfiguration="LoginServiceSoap12Binding"
contract="CWALoginService.LoginServicePortType" name="LoginServiceHttpsSoap12Endpoint" />
什么是不确定我在这里面临的问题...
多数情况下,这意味着您的主机返回错误页面(因为内容类型为所述的text/html
),而不是您的服务在application/soap+xml
返回响应。
您应该通过输入服务的URL( http(s)://localhost{:port}/{subSite}/(WCF URL).svc
)检查服务是否可以成功激活。 如果您的服务可以被激活,那么接下来您应该尝试的是通过以下步骤在客户端和服务端启用wcf跟踪:
Edit WCF Configuration
Diagnostics
部分,启用Log Auto Flush
, MessageLogging
和Tracing
,当然指定您的主机的身份访问写的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.