Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 require_once('PEAR.php');
00023
00034 class ilBMFFault extends PEAR_Error
00035 {
00036
00047 function ilBMFFault($faultstring = 'unknown error', $faultcode = 'Client', $faultactor=NULL, $detail=NULL, $mode = null, $options = null)
00048 {
00049 parent::PEAR_Error($faultstring, $faultcode, $mode, $options, $detail);
00050 if ($faultactor) $this->error_message_prefix = $faultactor;
00051 }
00052
00061 function message()
00062 {
00063 $msg =& new ilBMFBase();
00064 $params = array();
00065 $params[] =& new ilBMFValue('faultcode', 'QName', 'SOAP-ENV:'.$this->code);
00066 $params[] =& new ilBMFValue('faultstring', 'string', $this->message);
00067 $params[] =& new ilBMFValue('faultactor', 'anyURI', $this->error_message_prefix);
00068 if (isset($this->backtrace)) {
00069 $params[] =& new ilBMFValue('detail', 'string', $this->backtrace);
00070 } else {
00071 $params[] =& new ilBMFValue('detail', 'string', $this->userinfo);
00072 }
00073
00074 $methodValue =& new ilBMFValue('{'.SOAP_ENVELOP.'}Fault', 'Struct', $params);
00075 $headers = NULL;
00076 return $msg->_makeEnvelope($methodValue, $headers);
00077 }
00078
00087 function getFault()
00088 {
00089 global $SOAP_OBJECT_STRUCT;
00090 if ($SOAP_OBJECT_STRUCT) {
00091 $fault =& new stdClass();
00092 $fault->faultcode = $this->code;
00093 $fault->faultstring = $this->message;
00094 $fault->faultactor = $this->error_message_prefix;
00095 $fault->detail = $this->userinfo;
00096 return $fault;
00097 }
00098 return array(
00099 'faultcode' => $this->code,
00100 'faultstring' => $this->message,
00101 'faultactor' => $this->error_message_prefix,
00102 'detail' => $this->userinfo
00103 );
00104 }
00105
00114 function getActor()
00115 {
00116 return $this->error_message_prefix;
00117 }
00118
00127 function getDetail()
00128 {
00129 return $this->userinfo;
00130 }
00131
00132 }
00133 ?>