ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
SoapResponseHandler.php
Go to the documentation of this file.
1 <?php
7 namespace Whoops\Handler;
8 
9 
17 {
21  public function handle()
22  {
23  $exception = $this->getException();
24 
25  echo $this->toXml($exception);
26 
27  return Handler::QUIT;
28  }
29 
33  private function toXml(\Exception $exception)
34  {
35  $xml = '';
36  $xml .= '<?xml version="1.0" encoding="UTF-8"?>';
37  $xml .= '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">';
38  $xml .= ' <SOAP-ENV:Body>';
39  $xml .= ' <SOAP-ENV:Fault>';
40  $xml .= ' <faultcode>'. htmlspecialchars($exception->getCode()) .'</faultcode>';
41  $xml .= ' <faultstring>'. htmlspecialchars($exception->getMessage()) .'</faultstring>';
42  $xml .= ' <detail><trace>'. htmlspecialchars($exception->getTraceAsString()) .'</trace></detail>';
43  $xml .= ' </SOAP-ENV:Fault>';
44  $xml .= ' </SOAP-ENV:Body>';
45  $xml .= '</SOAP-ENV:Envelope>';
46 
47  return $xml;
48  }
49 }
Whoops - php errors for cool kids.
Catches an exception and converts it to an Soap XML response.
toXml(\Exception $exception)
Converts a Exception into a SoapFault XML.
Abstract implementation of a Handler.
Definition: Handler.php:16