note 90252 modified in soapclient.getlastrequest by thiago
| From: | thiago@php.net | Date: | Mon, 13 Apr 2009 12:05:45 +0000 |
| Subject: | note 90252 modified in soapclient.getlastrequest by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153139@lists.php.net to get a copy of this message | ||
I guess many peoples calls getLastRequest and it returns nothing. "Heey where is the my last
request". Now we will see our request, when you created a SoapClient instance, you should give
a option parameter as below :
<?php
// below $option=array('trace',1);
// correct one is below
$option=array('trace'=>1);
$client=new SoapClient('some.wsdl',$option);
try{
$client->aMethodAtRemote();
}catch(SoapFault $fault){
// <xmp> tag displays xml output in html
echo 'Request : <br/><xmp>',
$client->__getLastRequest(),
'</xmp><br/><br/> Error Message : <br/>',
$fault->getMessage();
}
?>
"trace" parameter enables output of request. Now, you should see SOAP request.
--was--
I guess many peoples calls getLastRequest and it returns nothing. "Heey where is the my last
request". Now we will see our request, when you created a SoapClient instance, you should give
a option parameter as below :
<?php
$option=array('trace',1);
$client=new SoapClient('some.wsdl',$option);
try{
$client->aMethodAtRemote();
}catch(SoapFault $fault){
echo 'Request : <br/>',
$client->__getLastRequest(),
'<br/><br/> Error Message : <br/>',
$fault->getMessage();
}
?>
"trace" parameter enables output of request. Now, you should see SOAP request.
http://php.net/manual/en/soapclient.getlastrequest.php