|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47021 SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked"
Submitted: 2009-01-06 16:28 UTC Modified: 2009-04-16 10:56 UTC
Avg. Score:4.5 ± 0.8
Reproduced:46 of 46 (100.0%)
Same Version:28 (60.9%)
Same OS:29 (63.0%)
From: daniel dot gorski at develnet dot org Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3CVS-2009-01-06 (CVS) OS: Linux
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-01-06 16:28 UTC] daniel dot gorski at develnet dot org
The \SoapClient (and probably the \SoapServer) stumble over WSDL files that are delivered via HTTP in chunks, carrying the HTTP response header "Transfer-Encoding: chunked".

Reproduce code:
$sc = \SoapClient('http://any.wsdl/that/is/delivered/in/chunks');

Expected result:
No error, intantiation and initialization of the \SoapClient object.

Actual result:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from [URL]: Start tag expected, '<' not found in [FILE]


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-22 15:35 UTC] ml at x-net dot be
I can confirm this bug. I tried avoiding the chunking in Apache by using mod_deflate, but the PHP SOAP client probably doesn't send an Accept-Encoding header with gzip in it.
 [2009-01-26 10:54 UTC] giovanni at giacobbi dot net
Please see related discussion:

See also bug report #43069 which actually caused this bug.
 [2009-04-16 10:34 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2009-04-16 10:56 UTC]
This was fixed by introducing an 'dechunk' stream filter, see

 [2009-05-17 05:18 UTC] shadda at gmail dot com
I ran into this bug today myself, and after having compiled the latest snapshot as of 8:00pm CST 2009-05-16 I am still experiencing this error.
 [2010-03-03 12:26 UTC] pcdinh at gmail dot com
Have you tried to recompile PHP with --without-curlwrapper? I solved my case.
 [2010-08-17 19:14 UTC] n dot engyozov at taxundo dot com
I can confirm the problem is still present in my PHP version 5.3.3 even after recompiling with changes made by Dmitry and with disabled curlwrapper. The problem breaks wsdls from yahoo i google APIs.
 [2012-05-16 15:45 UTC] gbaudoin at gmail dot com
Workaround : Use a stream context specifying the protocol 1.0 of HTTP :

$opts = array('http' => array('protocol_version' => '1.0'));
$context = stream_context_create($opts);
$this->client = new SoapClient($wsdl, array('stream_context' => $context));
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 19:01:31 2015 UTC