间歇内容类型的绑定失败

时间:2015-07-22 10:49:33

标签: c# web-services wcf character-encoding wcf-binding

我使用WCF多次向Web服务发送相同的请求,并且我的一些请求失败并显示以下错误消息。

The content type text/xml;UTF-8; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly

当我用Fiddler检查成功和失败尝试的原始消息时,我发现存在以下差异。

成功

HTTP/1.1 200 OK
Date: Fri, 10 Jul 2015 07:15:57 GMT
Server: unknown
Content-Length: 1502
X-Powered-By: Servlet/2.5 JSP/2.1
Content-Type: text/xml; charset=utf-8

失败

HTTP/1.1 200 OK
Date: Fri, 10 Jul 2015 07:16:03 GMT
Server: unknown
X-Powered-By: Servlet/2.5 JSP/2.1
Transfer-Encoding: chunked
Content-Type: text/xml;UTF-8; charset=UTF-8

成功观察到的消息没有Transfer-Encoding和text / xml; UTF-8字段。

我不确定这些额外内容是否会导致错误?什么可能导致这种差异,我该如何克服这个问题?

0 个答案:

没有答案