當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Soap_Server::fault方法代碼示例

本文整理匯總了PHP中Zend_Soap_Server::fault方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Soap_Server::fault方法的具體用法?PHP Zend_Soap_Server::fault怎麽用?PHP Zend_Soap_Server::fault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Soap_Server的用法示例。


在下文中一共展示了Zend_Soap_Server::fault方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fault

 /**
  * Generate a server fault
  *
  * Note that the arguments are the reverse of those used by SoapFault.
  *
  * Moodle note: the difference with the Zend server is that we throw a SoapFault exception
  * with the debuginfo integrated in the exception message when DEBUG >= NORMAL
  *
  * If an exception is passed as the first argument, its message and code
  * will be used to create the fault object if it has been registered via
  * {@Link registerFaultException()}.
  *
  * @link   http://www.w3.org/TR/soap12-part1/#faultcodes
  * @param  string|Exception $fault
  * @param  string $code SOAP Fault Codes
  * @return SoapFault
  */
 public function fault($fault = null, $code = "Receiver")
 {
     //intercept any exceptions with debug info and transform it in Moodle exception
     if ($fault instanceof Exception) {
         //add the debuginfo to the exception message if debuginfo must be returned
         if (debugging() and isset($fault->debuginfo)) {
             $fault = new SoapFault('Receiver', $fault->getMessage() . ' | DEBUG INFO: ' . $fault->debuginfo);
         }
     }
     return parent::fault($fault, $code);
 }
開發者ID:LMSeXT,項目名稱:SAWEE-WS_server-engine,代碼行數:28,代碼來源:locallib.php

示例2: fault

 /**
  * Generate a server fault
  *
  * Note that the arguments are reverse to those of SoapFault.
  *
  * note: the difference with the Zend server is that we throw a SoapFault exception
  * with the debuginfo integrated to the exception message when DEBUG >= NORMAL
  *
  * If an exception is passed as the first argument, its message and code
  * will be used to create the fault object if it has been registered via
  * {@Link registerFaultException()}.
  *
  * @link   http://www.w3.org/TR/soap12-part1/#faultcodes
  * @param  string|Exception $fault
  * @param  string $code SOAP Fault Codes
  * @return SoapFault
  */
 public function fault($fault = null, $code = "Receiver")
 {
     //run the zend code that clean/create a soapfault
     $soapfault = parent::fault($fault, $code);
     //intercept any exceptions and add the errorcode and debuginfo (optional)
     $actor = null;
     $details = null;
     if ($fault instanceof Exception) {
         //add the debuginfo to the exception message if debuginfo must be returned
         if (ws_debugging() and isset($fault->debuginfo)) {
             $details = $fault->debuginfo;
         }
     }
     return new SoapFault($soapfault->faultcode, $soapfault->getMessage() . ' | ERRORCODE: ' . (isset($fault->errorcode) ? $fault->errorcode : $code), $actor, $details);
 }
開發者ID:rboyatt,項目名稱:mahara,代碼行數:32,代碼來源:locallib.php

示例3: testFaultWithIntegerFailureCodeDoesNotBreakClassSoapFault

 /**
  * @group ZF-3958
  */
 public function testFaultWithIntegerFailureCodeDoesNotBreakClassSoapFault()
 {
     $server = new Zend_Soap_Server();
     $fault = $server->fault("Faultmessage!", 5000);
     $this->assertTrue($fault instanceof SOAPFault);
 }
開發者ID:omusico,項目名稱:logica,代碼行數:9,代碼來源:ServerTest.php


注:本文中的Zend_Soap_Server::fault方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。