|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30329 Error Fetching http body, No Content-Length, connection closed or chunked data
Submitted: 2004-10-05 13:57 UTC Modified: 2007-02-23 01:00 UTC
Avg. Score:3.7 ± 1.2
Reproduced:13 of 14 (92.9%)
Same Version:5 (38.5%)
Same OS:2 (15.4%)
From: Assigned: dmitry
Status: No Feedback Package: SOAP related
PHP Version: 5.0.2 OS: Solaris 9
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-10-05 13:57 UTC]
I get the error message "Error Fetching http body, No Content-Length, connection closed or chunked data [faultcode]" when try to communicate with Sybase EAServer via SOAP.
When redirecting the web services via a Proxy-Plugin in an iPlanet webserver everything works ok.
It seems that EAServer sends some bad encoded HTTP body.
When changing the SOAP extension code to only support HTTP/1.0, everything works.
How about introducing an additional option to SoapClient named "http_version" that can be set to 1.1 or 1.0 (default 1.1). At this time "1.1" is hardcoded into php_http.c.
When 1.0 is on, "Connection:" should be assumed as "close".

Something other:
If the extension CURL is used, why not use CURL for sending SOAP requests?

Reproduce code:
<h1>SOAP Test</h1>
    $ws=new SoapClient("",array('trace'=>TRUE));
    try {
    } catch (SoapFault $sf) {
        echo "<pre>".print_r($sf)."</pre>";
    echo "<h2>Request</h2><pre>".htmlspecialchars($ws->__getLastRequest())."</pre><h2>Response</h2><pre>".htmlspecialchars($ws->__getLastResponse())."</pre>";
    echo "<h2>Decoded</h2><pre>";

Expected result:
no SoapFault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-05 14:45 UTC]
The problem also sometimes occurs even with HTTP/1.0. After checking this, it seems that EAServer does not send a Content-Length! Can we change this in a way that get_http_body also accepts a zero content-length?
 [2004-10-05 14:50 UTC]
I don't think we should add workarounds around other buggy products. This is violating the RFC iirc.
 [2004-10-05 15:02 UTC]
incorrect. The EAServer does respond with HTTP/1.0. And in HTTP/1.0 you can leave out the Content-Length (if unknown), because chunked encoding cannot be used with 1.0
 [2004-12-01 19:23 UTC]
Fixed in CVS HEAD and PHP_5_0.
 [2004-12-01 19:48 UTC]
Works fine. You even found the new URL of weservice during testing with our application server... :)
-- Uwe
 [2007-02-15 09:15 UTC]
I am seeing the same issue on PHP 5.1.6

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5

Set-Cookie: JSESSIONID=DB0CD599DFF853F3A04B4B64819C4A7A; Path=/

Content-Type: text/xml;charset=UTF-8

Transfer-Encoding: chunked

Date: Thu, 15 Feb 2007 09:11:56 GMT


<env:Envelope xmlns:env=''>
 [2007-02-15 15:12 UTC]
You probably posted incomplete HTTP response. It must be terminated with 0-size chunk. The failure could occur because of error in "chunced" response or incomplete response. 
I think the problem is in your SOAP server software.
 [2007-02-23 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 02:01:32 2015 UTC