Go to the documentation of this file.00001 <?php
00026 require_once('PEAR.php');
00027
00037 class ilBMFFault extends PEAR_Error
00038 {
00039
00050 function ilBMFFault($faultstring = 'unknown error', $faultcode = 'Client', $faultactor=NULL, $detail=NULL, $mode = null, $options = null)
00051 {
00052 parent::PEAR_Error($faultstring, $faultcode, $mode, $options, $detail);
00053 if ($faultactor) $this->error_message_prefix = $faultactor;
00054 }
00055
00064 function message()
00065 {
00066 $msg =& new ilBMFBase();
00067 $params = array();
00068 $params[] =& new ilBMFValue('faultcode', 'QName', 'SOAP-ENV:'.$this->code);
00069 $params[] =& new ilBMFValue('faultstring', 'string', $this->message);
00070 $params[] =& new ilBMFValue('faultactor', 'anyURI', $this->error_message_prefix);
00071 if (isset($this->backtrace)) {
00072 $params[] =& new ilBMFValue('detail', 'string', $this->backtrace);
00073 } else {
00074 $params[] =& new ilBMFValue('detail', 'string', $this->userinfo);
00075 }
00076
00077 $methodValue =& new ilBMFValue('{'.SOAP_ENVELOP.'}Fault', 'Struct', $params);
00078 $headers = NULL;
00079 return $msg->_makeEnvelope($methodValue, $headers);
00080 }
00081
00090 function getFault()
00091 {
00092 global $SOAP_OBJECT_STRUCT;
00093 if ($SOAP_OBJECT_STRUCT) {
00094 $fault =& new stdClass();
00095 $fault->faultcode = $this->code;
00096 $fault->faultstring = $this->message;
00097 $fault->faultactor = $this->error_message_prefix;
00098 $fault->detail = $this->userinfo;
00099 return $fault;
00100 }
00101 return array(
00102 'faultcode' => $this->code,
00103 'faultstring' => $this->message,
00104 'faultactor' => $this->error_message_prefix,
00105 'detail' => $this->userinfo
00106 );
00107 }
00108
00117 function getActor()
00118 {
00119 return $this->error_message_prefix;
00120 }
00121
00130 function getDetail()
00131 {
00132 return $this->userinfo;
00133 }
00134
00135 }
00136 ?>