note 60364 added to function.soap-soapclient-getlastresponse

From: Date: Wed, 04 Jan 2006 21:30:00 +0000
Subject: note 60364 added to function.soap-soapclient-getlastresponse
Groups: php.notes 
Request: Send a blank email to php-notes+get-101225@lists.php.net to get a copy of this message
You almost for sure will need to wrap a try/catch block around your SOAP call in order to use these to debug something that's not working. Otherwise, PHP throws a fatal error before you can execute this function. For example: <?php $soapClient = new SoapClient($url); echo htmlentities($soapClient->__getFunctions()); //Assume that has output 'someFunction' (among others) try { $results = $soapClient->someFunction(...); } catch (SoapFault $soapFault) { var_dump($soapFault); echo "Request :<br>", htmlentities($soapClient->__getLastRequest()), "<br>"; echo "Response :<br>", htmlentities($soapClient->__getLastResponse()), "<br>"; } ?> Without try/catch, your just get the Fatal Error and PHP commits suicide before you can call __getLastRequest/__getLastResponse ---- Manual Page -- http://www.php.net/manual/en/function.soap-soapclient-getlastresponse.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60364 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60364&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60364&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60364&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60364&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60364&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60364&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60364&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60364&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101225) next »