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



PHP : Function Reference : SOAP Functions : use_soap_error_handler

use_soap_error_handler

Set whether to use the SOAP error handler and return the former value (PHP 5)
bool use_soap_error_handler ( [bool handler] )


Code Examples / Notes » use_soap_error_handler

msynak dot no dot spam dot please

This function seems to disable/enable automatic error reporting through SOAP. Use it to prevent user "on the other side" from seeing internal errors of your application.
Sometimes it is better to send no answer at all than to inform users that your application has e.g. parse errors.
Usage:
// disable error reporting
use_soap_error_handler(false);
// enable error reporting
use_soap_error_handler(true);
Default state of soap error handler is ENABLED.
It seems that the best practice is to disable it in constructor of your SOAP request handling class and enable in destructor.
For some situations, you may want to create your own error handling function instead (see set_error_handler and set_exception_handler) and throw custom SoapFaults with info like: "We have technical difficulties at the moment. Sorry!".


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