Bug #67427 [Opn->Csd]: SoapServer cannot handle large messages
Edit report at https://bugs.php.net/bug.php?id=67427&edit=1
ID: 67427
Updated by: felipe@php.net
Reported by: brandt at docoloc dot de
Summary: SoapServer cannot handle large messages
-Status: Open
+Status: Closed
Type: Bug
Package: SOAP related
Operating System: Linux, Debian jessie
PHP Version: 5.6.2
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of felipensp@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=40c60b8212b8ab18fd5bf9a426f99e42d9908f8e
Log: - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de
Previous Comments:
------------------------------------------------------------------------
[2015-01-25 16:57:05] omars@php.net
This can be a good reason why it shouldn't be enabled by default ever:
http://en.wikipedia.org/wiki/Billion_laughs
------------------------------------------------------------------------
[2015-01-25 16:47:40] omars@php.net
I don't think setting it globally is a good idea, they must have put that flag there for a
reason. I'd recommend that it would be one of the options the user can set on demand.
------------------------------------------------------------------------
[2014-11-25 10:04:45] brandt at docoloc dot de
The given patch solves the problem by setting libxml:XML_PARSE_HUGE in ext/soap/php_xml.c
------------------------------------------------------------------------
[2014-06-12 16:54:38] brandt at docoloc dot de
Description:
------------
Since php-5.6.0 SOAP messages bigger than about 9.9MB (I haven't tested the exact value) are
not processed correctly on the SoapServer. Instead a SoapFault "Bad Request" is returned
to the SoapClient and PHP produces the following warning:
PHP Warning: SoapServer::handle(): php://input:2: parser error : xmlSAX2Characters: huge text node
in /var/www/soapapi/server.php on line 19
PHP Warning: SoapServer::handle():
bLklQQOUHbKlsdztx6mvbvj7b3knhnQ7gWsl1p9tcrJeRKD02YBLAZUfeGfVh3xVS2+Inhh7Yaf4J8Ky in
/var/www/soapapi/server.php on line 19
PHP Warning: SoapServer::handle():
^ in /var/www/soapapi/server.php on line 19
With php-5.5.12 the exact same code works fine with such big SOAP messages.
I guess libxml:XML_PARSE_HUGE needs to be set somewhere in order to process such big messages.
Test script:
---------------
At http://viking.docoloc.de/soapapi.tgz you can
find a simple SOAP example, consisting of a WSDL file, a server.php as well as a client.php. This
example allows uploading of files to the SOAP server which will return the file size in bytes. When
using this code you need to set the correct hostname of the server in client.php as well as in
SoapAPI.wsdl.
When uploading a file up to a size of about 7MB everything works fine and client.php writes the
number of bytes as returned from the SoapServer to stdout. But when uploading a file of 7.5MB (due
to base64 encoding this produces a SOAP message of about 9.9MB) the SoapFault "Bad
Request" is produced.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67427&edit=1
Thread (8 messages)