php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43991 Content-Length in HTTP header from PHP SOAP wrong
Submitted: 2008-01-31 12:13 UTC Modified: 2009-04-28 18:35 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: s dot slater at cabletime dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.5 OS: Windows Vista + IIS7.0
Private report: No CVE-ID: None
 [2008-01-31 12:13 UTC] s dot slater at cabletime dot com
Description:
------------
PHP SOAP seems to return an incorrect Content-Length in the HTTP header (8 bytes too small) which causes a problem with IIS7 on Windows Vista.  

Note that the incorrect value is present but does not cause a problem with IIS5.1 on XP or with Apache on Vista, XP or Linux.  You don't see any symptoms unless using IIS7.

Reproduce code:
---------------
The problem seems to occur on any response I get from PHP SOAP.

Used 5.2.5 installed with Windows installer with SOAP + PDO SQLite modules and running as CGI

Expected result:
----------------
Looking at a specific example with Wireshark on various servers, the full body of the SOAP response consists of 578 bytes:

	SP CR LF
	569 bytes of XML
	LF SP CR LF CR LF

I would expect the HTTP header to include Content-Length: 578

Actual result:
--------------
The HTTP header contains Content-Length: 570

What I actually receive in the client is:

With IIS7: 570 bytes of body, so the last two bytes of the XML are truncated and my Java applet client software won't parse it

With IIS5.1: 570 bytes of body followed by a second HTTP packet containing the last 8 bytes, which works

With Apache: The whole response in one HTTP packet with no truncation, which works

So the SOAP communication still works OK on the older IIS and Apache even with the incorrect content length, but on each message sent by vista the response ends with "</SOAP-ENV:Envelop" and the "e>" and terminating bytes are missing.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-31 08:34 UTC] zkroecher at gingco dot net
We have the same problem on Windows 2008 Server with IIS7, using php5ispai.dll.
No solution yet?
 [2009-04-08 07:20 UTC] zkroecher at gingco dot net
Okay, we probably found the problem:
In our case there was a BOM anywhere in the included PHP Files of our App. Now that we removed it this problem doesn't occur anymore an we get wellformed XML with correct Content-Length.

But we reproduced the same error on a Win2003 Server with IIS6 before as well. Submitter S Dot Slater tested this but couldn't reproduce the problem on such an environment.
 [2009-04-20 10:12 UTC] s dot slater at cabletime dot com
We are no longer using the PHP SOAP interface, but for the benefit of anyone reading this report I never tried Win2003 Server or IIS6,  only the environments listed in the report.
 [2009-04-28 18:36 UTC] jani@php.net
No need to keep this report open then. We have other reports about 
similar issue with active users.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Dec 07 21:03:33 2021 UTC