note 112970 deleted from soapclient.soapclient by crell
| From: | crell@php.net | Date: | Mon, 04 Apr 2022 16:51:27 +0000 |
| Subject: | note 112970 deleted from soapclient.soapclient by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218100@lists.php.net to get a copy of this message | ||
Note Submitter: tolean dot dj at gmail dot com
----
Here's a function for easier debugging:
<?php
function soapDebug($client){
$requestHeaders = $client->__getLastRequestHeaders();
$request = prettyXml($client->__getLastRequest());
$responseHeaders = $client->__getLastResponseHeaders();
$response = prettyXml($client->__getLastResponse());
echo '<code>' . nl2br(htmlspecialchars($requestHeaders, true)) .
'</code>';
echo highlight_string($request, true) . "<br/>\n";
echo '<code>' . nl2br(htmlspecialchars($responseHeaders, true)) .
'</code>' . "<br/>\n";
echo highlight_string($response, true) . "<br/>\n";
}
$client = new SoapClient(null, array(
'location' => 'http://sita.local/_mpay/server.php',
'uri' => 'http://sita.local/_mpay/',
'trace' => 1,
));
$result = $client->__soapCall('getDate', array('format' => 'Y-m-d
H:i:s'));
soapDebug($client);
?>