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:27
Avg. Score:3.9 ± 1.2
Reproduced:18 of 19 (94.7%)
Same Version:6 (33.3%)
Same OS:4 (22.2%)
From: thetaphi@php.net Assigned: dmitry (profile)
Status: No Feedback Package: SOAP related
PHP Version: 5.0.2 OS: Solaris 9
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 - 27 = ?
Subscribe to this entry?

 
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 23:01:27 2024 UTC