问题
I am getting the following error. What is wrong? How I can catch or solve this exception.
Fatal error: Uncaught SoapFault exception: [a:InternalServiceFault] The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs. in G:\work\htdocs\Robi_Francis_API\application\controllers\mirsValidation.php:117 Stack trace: #0 G:\work\htdocs\Robi_Francis_API\application\controllers\mirsValidation.php(117): SoapClient->__call('processPayment', Array) #1 G:\work\htdocs\Robi_Francis_API\application\controllers\mirsValidation.php(117): SoapClient->processPayment(Array) #2 [internal function]: MirsValidation->process('13774373733576') #3 G:\work\htdocs\Robi_Francis_API\system\core\CodeIgniter.php(359): call_user_func_array(Array, Array) #4 G:\work\htdocs\Robi_F in G:\work\htdocs\Robi_Francis_API\application\controllers\mirsValidation.php on line 117
回答1:
Try this:
<?php
try {
$url = "/api/TestService.asmx?wsdl";
$client = new SoapClient($url, array("trace" => 1, "exception" => 0));
} catch (SoapFault $exception) {
echo $exception->getMessage();
}
?>
来源:https://stackoverflow.com/questions/17401452/how-to-catch-uncaught-soapfault-exception