简体   繁体   中英

WCF Content-Length mismatch when using IIS Compression

I have an issue where if I enable dynamic content compression in IIS 7.5, I get a different content length. I know this could happen since the data is being compressed but the problem is it is actually bigger.

Before 无压缩 After 启用压缩

I know there are related posts like this one but the solutions are often modules modifying the content-length. In this example, I ruled that out by using a simple demo WCF app but I still get an incorrect content length. IF you think I missed the correct question / answer, just let me know.

WCF service returns incorrect Content-Length when using gzip encoding

Here is the solution of the demo wcf I am using. https://github.com/janmchan/WCFDemo.git

As it turns out, there was nothing wrong with the response. Using fiddler, I could see the saw response as the compressed version and it seems that the length corresponds to the length of those characters. So our conclusion is that the end system receiving this does not know how to handle the compressed response. I'll keep this answer open for debate until we have confirmed that this is the case.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM