Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : SOAP Functions : SoapClient->__getLastResponse()

SoapClient->__getLastResponse()

Returns last SOAP response. ()

Example 2275. SoapClient->__getLastResponse() example

<?php
$client
= SoapClient("some.wsdl", array('trace' => 1));
$result = $client->SomeFunction();
echo
"RESPONSE:\n" . $client->__getLastResponse() . "\n";
?>

Related Examples ( Source code ) » soap_soapclient_getlastresponse






Code Examples / Notes » soap_soapclient_getlastresponse

ceo

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 :
", htmlentities($soapClient->__getLastRequest()), "
";
       echo "Response :
", htmlentities($soapClient->__getLastResponse()), "
";
   }
?>
Without try/catch, your just get the Fatal Error and PHP commits suicide before you can call __getLastRequest/__getLastResponse


Change Language


Follow Navioo On Twitter
is_soap_fault
SoapClient->__call()
SoapClient->__construct()
SoapClient->__doRequest()
SoapClient->__getFunctions()
SoapClient->__getLastRequest()
SoapClient->__getLastRequestHeaders()
SoapClient->__getLastResponse()
SoapClient->__getLastResponseHeaders()
SoapClient->__getTypes()
SoapClient->__setCookie()
SoapClient->__soapCall()
SoapFault->__construct()
SoapHeader->__construct()
SoapParam->__construct()
SoapServer->addFunction()
SoapServer->__construct()
SoapServer->fault()
SoapServer->getFunctions()
SoapServer->handle()
SoapServer->setClass()
SoapServer->setPersistence()
SoapVar->__construct()
use_soap_error_handler
eXTReMe Tracker