“在发送HTTP标头后,服务器无法设置状态”过http但不是https [英] "Server cannot set status after HTTP headers have been sent" over http but not https

查看:175
本文介绍了“在发送HTTP标头后,服务器无法设置状态”过http但不是https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将.net网络服务从Windows Server 2003迁移到Windows Server 2008 R2。当尝试访问Web服务帮助页面时,浏览器将等待服务器请求,但什么也没发生。请求只是挂起,我从来没有得到超时或任何其他状态代码。检查服务器上的HTTPERR日志时,我看到请求已取消且没有状态代码。 (见下文)

I recently migrated a .net web service from Windows Server 2003 to Windows Server 2008 R2. When trying to access the web service help page the browser will wait for the server request but nothing ever happens. The request just hangs and I never get a timeout or any other status code. When checking the HTTPERR logs on the server, I see that the request was cancelled and has no status code. (See Below)

2015-06-02 15:20:49 11.127.2.128 50755 11.113.4.14 56272 HTTP/1.1 GET /HumanResourceServices/1_0_0/help/ - 2 Request_Cancelled HumanResourceServices

我查看了这个问题 HTTPERR日志:Request_Cancelled(在对WCF服务进行故障排除时)并完成建议的日志记录。生成svc日志文件但它保持0字节大小并且永远不会更改。我检查了IIS中的工作进程,它收到了对该站点的请求,但是当我转到查看当前请求时,我没有看到请求。似乎我的请求永远不会被处理,取消,服务器永远不会响应状态代码。为了让事情变得更有趣,如果我通过https访问同一个站点,它就可以了!所以这只发生在我尝试通过http访问时。任何有关如何进一步解决此问题的建议或建议都非常感谢。

I reviewed this question HTTPERR log: Request_Cancelled (while troubleshooting WCF service) and did the suggested logging. The svc log file is generated but it stays at 0 byte size and never changes. I checked the worker processes in IIS and it gets a request for the site but I do not see request when I go to "View Current Request" for it. It seems like my request is never getting processed, cancelled and the server never responds with a status code. To make things even more interesting, if I access the same site over https, it works! So this is only happening when I try to access over http. Any advice or suggestions on ways to further troubleshoot this is much appreciated.

更新 -

我能够让日志工作。请求被取消,因为应用程序正在抛出异常。错误消息服务器无法在发送HTTP标头后设置状态。有没有人知道为什么我会通过http而不是通过https获得此错误?另请注意,这只发生在新的Windows 2008 R2服务器上。我们的旧服务器Windows Server 2003(IIS 6.0)没有这个问题。

I was able to get the log working. The request is being cancelled because the application is throwing an exception. The error message is "Server cannot set status after HTTP headers have been sent." Does anyone have any idea why I would be getting this error over http but not over https? Also note, this is only happening on the new Windows 2008 R2 server. Our old server Windows Server 2003 (IIS 6.0) did not have this problem.

谢谢

推荐答案

看起来这是我的疏忽。应用程序池设置为集成时应该是经典的。一旦切换,问题就会消失。

Looks like this was an oversight on my part. The application pool was set to integrated when it should have been classic. Once it was switched, issue went away.

这篇关于“在发送HTTP标头后,服务器无法设置状态”过http但不是https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆