Tutorial :Using chunked encoding in a POST request to an asmx web service on IIS 6 generates a 404


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?



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?


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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »