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 new ilBMFValue('faultcode', 'QName', 'SOAP-ENV:'.$this->code),
00066 new ilBMFValue('faultstring', 'string', $this->message),
00067 new ilBMFValue('faultactor', 'anyURI', $this->error_message_prefix),
00068 new ilBMFValue('detail', 'string', $this->userinfo)
00069 );
00070 $methodValue = new ilBMFValue('{'.SOAP_ENVELOP.'}Fault', 'Struct', $params);
00071 $headers = NULL;
00072 return $msg->_makeEnvelope($methodValue, $headers);
00073 }
00074
00083 function getFault()
00084 {
00085 global $SOAP_OBJECT_STRUCT;
00086 if ($SOAP_OBJECT_STRUCT) {
00087 $fault = new stdClass();
00088 $fault->faultcode = $this->code;
00089 $fault->faultstring = $this->message;
00090 $fault->faultactor = $this->error_message_prefix;
00091 $fault->detail = $this->userinfo;
00092 return $fault;
00093 }
00094 return array(
00095 'faultcode' => $this->code,
00096 'faultstring' => $this->message,
00097 'faultactor' => $this->error_message_prefix,
00098 'detail' => $this->userinfo
00099 );
00100 }
00101
00110 function getActor()
00111 {
00112 return $this->error_message_prefix;
00113 }
00114
00123 function getDetail()
00124 {
00125 return $this->userinfo;
00126 }
00127
00128 }
00129 ?>