php.net |  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
Votes:43
Avg. Score:4.5 ± 0.8
Reproduced:41 of 41 (100.0%)
Same Version:24 (58.5%)
Same OS:25 (61.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
Description:
------------
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]

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

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:
http://marc.info/?t=123291993300002&r=1&w=2

See also bug report #43069 which actually caused this bug.
 [2009-04-16 10:34 UTC] dmitry@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2009-04-16 10:56 UTC] bjori@php.net
This was fixed by introducing an 'dechunk' stream filter, see http://news.php.net/php.cvs/57042

 [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-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 15:02:26 2014 UTC