how to catch Uncaught SoapFault exception [closed]

徘徊边缘 提交于 2019-12-13 02:36:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!