<bdo id='Pea1N'></bdo><ul id='Pea1N'></ul>
  • <small id='Pea1N'></small><noframes id='Pea1N'>

    <legend id='Pea1N'><style id='Pea1N'><dir id='Pea1N'><q id='Pea1N'></q></dir></style></legend>

      <tfoot id='Pea1N'></tfoot>
      <i id='Pea1N'><tr id='Pea1N'><dt id='Pea1N'><q id='Pea1N'><span id='Pea1N'><b id='Pea1N'><form id='Pea1N'><ins id='Pea1N'></ins><ul id='Pea1N'></ul><sub id='Pea1N'></sub></form><legend id='Pea1N'></legend><bdo id='Pea1N'><pre id='Pea1N'><center id='Pea1N'></center></pre></bdo></b><th id='Pea1N'></th></span></q></dt></tr></i><div id='Pea1N'><tfoot id='Pea1N'></tfoot><dl id='Pea1N'><fieldset id='Pea1N'></fieldset></dl></div>

      1. PHP SoapFault 没有被异常处理程序捕获

        时间:2023-05-22

              <tbody id='eEiCG'></tbody>
            <tfoot id='eEiCG'></tfoot>
            • <bdo id='eEiCG'></bdo><ul id='eEiCG'></ul>

              <small id='eEiCG'></small><noframes id='eEiCG'>

                • <i id='eEiCG'><tr id='eEiCG'><dt id='eEiCG'><q id='eEiCG'><span id='eEiCG'><b id='eEiCG'><form id='eEiCG'><ins id='eEiCG'></ins><ul id='eEiCG'></ul><sub id='eEiCG'></sub></form><legend id='eEiCG'></legend><bdo id='eEiCG'><pre id='eEiCG'><center id='eEiCG'></center></pre></bdo></b><th id='eEiCG'></th></span></q></dt></tr></i><div id='eEiCG'><tfoot id='eEiCG'></tfoot><dl id='eEiCG'><fieldset id='eEiCG'></fieldset></dl></div>

                • <legend id='eEiCG'><style id='eEiCG'><dir id='eEiCG'><q id='eEiCG'></q></dir></style></legend>
                  本文介绍了PHP SoapFault 没有被异常处理程序捕获的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我是 PHP 异常处理和 SOAP 的新手.出于某种原因,我无法捕获 SoapFault.我不知道为什么.肥皂服务器不是我的.

                  I am new to PHP exception handling and SOAP. For some reason I cannot catch a SoapFault. I don't know why. The soap server is not mine.

                  try { 
                      $contact_id = $objSoapClient->getContactIdFromVisitorId('12345');
                  } 
                  catch (SoapFault $sf) { 
                      echo "Soapfault"; 
                  } 
                  catch (Exception $e) { 
                      echo "Exception"; 
                  }
                  

                  我故意传入错误 ID 12345.当我启用错误时,我看到以下消息 SoapFault 异常:[SOAP-ENV:Client] Invalid Visitor ID.但是,我的 catch SoapFault 块和我的 catch Exception 块都被击中.为什么?

                  I am purposely passing in the bad id 12345. When I enable errors I see the following message SoapFault exception: [SOAP-ENV:Client] Invalid Visitor ID. However, my catch SoapFault block nor my catch Exception block ever get hit. Why?

                  推荐答案

                  问题出在我的 SoapClient 声明上.必须设置一个异常参数才能触发异常.

                  The problem turned out to be my SoapClient declaration. There is an exceptions parameter that must be set in order for the exceptions to trigger.

                  $objSoapClient = new SoapClient('https://mywebservice.com/foo.wsdl', array(
                      "trace" => false,  
                      "exceptions" => true,     // <-------------- This!!!                                               
                      'login' => 'username',    //username
                      'password' => 'password', //password
                      'features' => SOAP_SINGLE_ELEMENT_ARRAYS + SOAP_USE_XSI_ARRAY_TYPE 
                  ));
                  

                  这篇关于PHP SoapFault 没有被异常处理程序捕获的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 PHP 中使用 SSL 证书发送 SOAP 请求? 下一篇:如何确定有效的 SoapAction?

                  相关文章

                  最新文章

                  <small id='UX3xC'></small><noframes id='UX3xC'>

                    • <bdo id='UX3xC'></bdo><ul id='UX3xC'></ul>
                    <i id='UX3xC'><tr id='UX3xC'><dt id='UX3xC'><q id='UX3xC'><span id='UX3xC'><b id='UX3xC'><form id='UX3xC'><ins id='UX3xC'></ins><ul id='UX3xC'></ul><sub id='UX3xC'></sub></form><legend id='UX3xC'></legend><bdo id='UX3xC'><pre id='UX3xC'><center id='UX3xC'></center></pre></bdo></b><th id='UX3xC'></th></span></q></dt></tr></i><div id='UX3xC'><tfoot id='UX3xC'></tfoot><dl id='UX3xC'><fieldset id='UX3xC'></fieldset></dl></div>
                    <legend id='UX3xC'><style id='UX3xC'><dir id='UX3xC'><q id='UX3xC'></q></dir></style></legend>

                      <tfoot id='UX3xC'></tfoot>