Search code examples
phpsoaplibxml2

How do I set XML_PARSE_HUGE for SoapClient?


I have a class that extends SoapClient

class SOAPWrapper extends \SoapClient
{
    public function GetSomething(GetSomething $parameters)
    {
      return $this->__soapCall('GetSomething', array($parameters));
    }
}

GetSomething is returning something bigger than 10MB, so I get the error:

Couldn't load from 'http://example.com/example.asmx' : Excessive depth in document: 256 use XML_PARSE_HUGE option

Which means I have to use the XML_PARSE_HUGE option, but I can't see in the __soapCall documentation how to do that.

Where and how do I set that option?


Solution

  • It's not possible to set custom parser options for SoapClient. But the missing XML_PARSE_HUGE option was reported as a bug and should be fixed in PHP 5.4.38, 5.5.23, and 5.6.7.