php.net |  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
Votes:20
Avg. Score:3.5 ± 1.2
Reproduced:11 of 12 (91.7%)
Same Version:5 (45.5%)
Same OS:2 (18.2%)
From: thetaphi@php.net 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] thetaphi@php.net
Description:
------------
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>
<?php
    $ws=new SoapClient("http://ws.pangaea.de:8084/ws/services/WebServices?wsdl",array('trace'=>TRUE));
    try {
        $res=$ws->metadata("10.1594/PANGAEA/206854");
    } 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>";
    print_r($res);
?>
</pre>

Expected result:
----------------
no SoapFault


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-05 14:45 UTC] thetaphi@php.net
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] derick@php.net
I don't think we should add workarounds around other buggy products. This is violating the RFC iirc.
 [2004-10-05 15:02 UTC] thetaphi@php.net
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] dmitry@php.net
Fixed in CVS HEAD and PHP_5_0.
 [2004-12-01 19:48 UTC] thetaphi@php.net
Works fine. You even found the new URL of weservice during testing with our application server... :)
-- Uwe
 [2007-02-15 09:15 UTC] lsmith@php.net
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



176

<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
 [2007-02-15 15:12 UTC] dmitry@php.net
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-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 17:01:54 2014 UTC