间歇性 413:通过 https 的 ASMX Web 服务请求实体太大错误
我有一个 ASMX Web 服务,它接受一些参数,其中之一是序列化的 jpg。这些文件的大小通常约为 100KB。
我能够调用我的服务并成功发送文件一段时间,然后它开始返回 413 错误。我已经嗅探了请求的线路,并且请求大小实际上是相同的(事实上,失败的调用比成功的调用小 500 个字节)。
如果我随后发送一个小得多的文件(例如 50KB),它会再次开始工作,然后我可以发送更大的文件一段时间。
我的 web.config 文件中有此内容:
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
This is over https on IIS 7.5 in Windows Server 2008 R2 SP1。任何帮助将不胜感激。谢谢!
- 更新 - 这似乎是解决方案:我将其粘贴在下面,希望其他人会发现它有用。
C:\Windows\System32\inetsrv>appcmd.exe set config -section:system.webServer/serverRuntime /uploadReadAheadSize:"1048576" /commit:apphost
I have an ASMX web service which accepts a few parameters, one of which is a serialized jpg. These files are generally ~100KB in size.
I am able to call my service and send the files successfully for a while, then it starts returning 413 errors. I've sniffed the wire for the requests, and the request sizes are virtually identical (and in fact, the failing call is smaller by 500 bytes than the successful call).
If I then send a much smaller file (say 50KB) it starts working again, and I can then send larger files for a while.
I have this in my web.config file:
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
This is over https on IIS 7.5 in Windows Server 2008 R2 SP1. Any help would be appreciated. Thanks!
--UPDATE--
This appears to be the solution: I'm pasting it below in the hopes that someone else will find it useful.
C:\Windows\System32\inetsrv>appcmd.exe set config -section:system.webServer/serverRuntime /uploadReadAheadSize:"1048576" /commit:apphost
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有趣的问题,我没有遇到过这个问题,但四处窥探了很多,似乎大多数人都通过调整 UploadReadAheadSize ,这是 iis.net 他们能够通过设置在 IIS7.5 上清除它applicationHost.config 中的值,祝你好运......
Interesting problem, I haven't had this issue but snooped around alot, seems like most people find some relief by adjusting the UploadReadAheadSize , here's a thread on iis.net where they were able to clear it up on IIS7.5 by setting that value in applicationHost.config, good luck...