在对 IIS 6 上的 asmx Web 服务的 POST 请求中使用分块编码会生成 404
我正在使用 CXF 客户端与 IIS 6 上运行的 .net Web 服务进行通信。 此请求(匿名):
POST /EngineWebService_v1/EngineWebService_v1.asmx HTTP/1.1 Content-Type: text/xml; charset=UTF-8 SOAPAction: "http://.../Report" Accept: */* User-Agent: Apache CXF 2.2.5 Cache-Control: no-cache Pragma: no-cache Host: uat9.gtios.net Connection: keep-alive Transfer-Encoding: chunked
后跟 7 个 4089 字节的块和一个 369 字节的块,在发送第一个块后生成以下输出:
HTTP/1.1 404 Not Found Content-Length: 103 Date: Wed, 10 Feb 2010 13:00:08 GMT Connection: Keep-Alive Content-Type: text/html
任何人都知道如何让 IIS 接受 POST 的分块输入?
谢谢
I'm using a CXF client to communicate with a .net web service running on IIS 6.
This request (anonymised):
POST /EngineWebService_v1/EngineWebService_v1.asmx HTTP/1.1 Content-Type: text/xml; charset=UTF-8 SOAPAction: "http://.../Report" Accept: */* User-Agent: Apache CXF 2.2.5 Cache-Control: no-cache Pragma: no-cache Host: uat9.gtios.net Connection: keep-alive Transfer-Encoding: chunked
followed by 7 chunks of 4089 bytes and one of 369 bytes, generates the following output after the first chunk has been sent:
HTTP/1.1 404 Not Found Content-Length: 103 Date: Wed, 10 Feb 2010 13:00:08 GMT Connection: Keep-Alive Content-Type: text/html
Anyone know how to get IIS to accept chunked input for a POST?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
分块编码应默认启用。您可以通过以下方式检查您的设置:
404 让我想知道这是否真的是分块编码的问题。您是否对 URL 进行了三重检查?
Chunked encoding should be enabled by default. You can check your setting with:
The 404 makes me wonder if it's really a problem with the chunked encoding. Did you triple-check the URL?
您的服务器上可能正在运行 URLScan。默认情况下,URLScan 配置为拒绝具有
transfer-encoding:
标头和 URLScan 发送 404 错误(这在正常的服务器错误上很明显)。您需要查看位于(路径可能不同)
C:\Windows\System32\inetsrv\URLScan\URLScan.ini
的文件。在其中的某个地方,您会发现一个[DenyHeaders]
部分,它看起来有点像这样(它可能会列出更多标头)。从此列表中删除
transfer-encoding:
,它应该可以解决您的问题。You may well have URLScan running on your server. By default URLScan is configured to reject requests that have a
transfer-encoding:
header and URLScan sends 404 errors (which is conspicuous over a proper server-error).You will need to look at the file located in (path may differ)
C:\Windows\System32\inetsrv\URLScan\URLScan.ini
. Somewhere in there you will find a[DenyHeaders]
section, that will look a bit like this (it will probably have more headers listed).Remove
transfer-encoding:
from this list and it should fix your problem.