protected function callbackExceptionHandler(Exception $ex) { switch ($case = $this->callback_protocol) { case self::SOAP: $result = parent::callbackExceptionHandler($ex); break; case self::REST: $result = array('template' => $this->path . '/templates/resultRest.html', 'result_code' => $ex->getCode(), 'header' => array('Content-type' => 'text/xml; charset=utf-8;')); break; default: $result = array('error' => 'unknown protocol'); } return $result; }