Consider this example SOAP Client script:
$SOAP = new SoapClient($WDSL); // Create a SOAP Client from a WSDL
// Build an array of data to send in the reques
The problem with Quinn Comendant's answer, that $request
from __doRequest()
will then be processed by __call()
and the user will see an array of parameters instead of real xml request. To prevent this, such workaround can be used:
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();
}
}
}
Option trace
is not necessary here, because we do not call __getLastRequest()
or other relevant functions.