The problem with Quinn Comendant's answer is that $request from __doRequest() will be processed by __call() , and then the user will see an array of parameters of the real xml request. To prevent this, you can use a workaround like this:
class DummySoapClient extends SoapClient { function __construct($wsdl, $options) { parent::__construct($wsdl, $options); } function __doRequest($request, $location, $action, $version, $one_way = 0) { throw new Exception($request); } function __call($function_name, $arguments) { try { parent::__call($function_name, $arguments); } catch (Exception $e) { return $e->getMessage(); } } }
The trace option is not needed here because we do not call __getLastRequest() or other appropriate functions.
Gino Pane May 12 '17 at 7:34 a.m. 2017-05-12 07:34
source share