如何捕获未捕获的SoapFault异常 [英] how to catch Uncaught SoapFault exception
问题描述
我收到以下错误。怎么了?我如何捕获或解决此异常。
I am getting the following error. What is wrong? How I can catch or solve this exception.
致命错误:未捕获的SoapFault异常:[a:InternalServiceFault]服务器无法处理内部错误导致请求。有关错误的更多信息,请打开服务器上的IncludeExceptionDetailInFaults(从ServiceBehaviorAttribute或从配置行为),以便将异常信息发送回客户端,或者根据Microsoft .NET Framework 3.0 SDK文档打开跟踪。并检查服务器跟踪日志。在G:\work\htdocs\Robi_Francis_API\application\controllers\mirsValidation.php:117中堆栈跟踪:#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(数组)#2 [内部函数]:MirsValidation-> process('13774373733576')#3 G:\work\htdocs\Robi_Francis_API\system\core\CodeIgniter.php(359):call_user_func_array(Array,数组)#4 G:linework\htdocs\Robi_F in G:\work\htdocs\Robi_Francis_API\application\controllers\mirsValidation.php行117
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
推荐答案
尝试一下:
<?php
try {
$url = "/api/TestService.asmx?wsdl";
$client = new SoapClient($url, array("trace" => 1, "exception" => 0));
} catch (SoapFault $exception) {
echo $exception->getMessage();
}
?>
这篇关于如何捕获未捕获的SoapFault异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!