我的.NET 4.0 Web应用程序项目中有一个WCF端点。使用VS2010 WCF测试客户端,我可以正确连接到该服务。但是,当我去使用该服务时,我收到一条通用错误消息:身份验证模式=“窗体”导致在WCF服务中重定向
内容类型text/html; charset =响应消息的UTF-8与绑定的内容类型(text/xml; charset = utf-8)不匹配。如果使用自定义编码器,请确保IsContentTypeSupported方法正确实施。第一个1024个字节的响应是:
当我看着IIS Express中的请求,我得到了以下内容:
请求启动:POST http://machinename:port/Services/Services.svc
请求启动:GET http://machinename:port/Services/Services.svc?AspxAutoDectectCookieSupport=1
Reque st结束:HTTP状态为“http:// machinename:port/Services/Services.svc”302.0
请求以HTTP结尾:“http:// machinename:port/Services/Services.svc?AspxAutoDectectCookieSupport = 1”状态302.0
请求结束: “HTTP://机器:端口/服务/ Services.svc AspxAutoDectectCookieSupport = 1?”,HTTP状态200.0
所以看起来它越来越张贴到售后服务重定向到服务的标准网页。然而,当我删除:
<authentication mode="Forms">
<forms cookieless="AutoDetect" loginUrl="~/Security/LoginClient.aspx" name="FORMAUTH" />
从它的工作的web.config。任何想法发生了什么?我试图从认证中删除服务所在的文件夹(http://stackoverflow.com/questions/5593720/authentication-mode-forms-causing-errors-in-wcf-end-point),但问题仍然存在。
虽然在我通过IIS Express 7.5运行时使用Visual Studio开发服务器(Cassini),但在使用或不使用身份验证时会发生相同的错误。
您好!面对同样的问题。你找到解决方案吗? – user1147981 2015-12-11 16:43:59