在对 IIS 6 上的 asmx Web 服务的 POST 请求中使用分块编码会生成 404

发布于 2024-08-21 03:28:11 字数 594 浏览 5 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

囍孤女 2024-08-28 03:28:11

分块编码应默认启用。您可以通过以下方式检查您的设置:

C:\Inetpub\AdminScripts>cscript adsutil.vbs get /W3SVC/AspEnableChunkedEncoding

404 让我想知道这是否真的是分块编码的问题。您是否对 URL 进行了三重检查?

Chunked encoding should be enabled by default. You can check your setting with:

C:\Inetpub\AdminScripts>cscript adsutil.vbs get /W3SVC/AspEnableChunkedEncoding

The 404 makes me wonder if it's really a problem with the chunked encoding. Did you triple-check the URL?

倥絔 2024-08-28 03:28:11

您的服务器上可能正在运行 URLScan。默认情况下,URLScan 配置为拒绝具有 transfer-encoding: 标头和 URLScan 发送 404 错误(这在正常的服务器错误上很明显)。

UrlScan v3.1 失败会导致 404 错误,而不是 500 错误。
在 W3SVC 日志中搜索 404 错误将包括由于以下原因导致的失败
阻止 UrlScan。

您需要查看位于(路径可能不同)C:\Windows\System32\inetsrv\URLScan\URLScan.ini 的文件。在其中的某个地方,您会发现一个 [DenyHeaders] 部分,它看起来有点像这样(它可能会列出更多标头)。

[DenyHeaders]

transfer-encoding:

从此列表中删除 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).

UrlScan v3.1 failures result in 404 errors and not 500 errors.
Searching for 404 errors in your W3SVC log will include failures due
to UrlScan blocking.

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).

[DenyHeaders]

transfer-encoding:

Remove transfer-encoding: from this list and it should fix your problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文