// // Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@4183f02c // // class Api_OwsException extends Exception { public $wfsCode = ''; public $wfsLocator = ''; public function __construct($message, $code = 0, Exception $previous = null, $wfsCode = '', $wfsLocator = '') { $this->wfsCode = $wfsCode; $this->wfsLocator = $wfsLocator; parent::__construct($message, $code, $previous); } public function generateResponseXml() { $xmlWriter = new XMLWriter(); if (!$xmlWriter) throw new HttpException("Error no XMLWriter", 404); // $xmlWriter->openUri('php://output'); $xmlWriter->openMemory(); $xmlWriter->setIndent(true); $xmlWriter->startDocument('1.0','UTF-8'); $xmlWriter->startElement('ows:ExceptionReport'); { $xmlWriter->writeAttribute('xmlns:xs', 'http://www.w3.org/2001/XMLSchema'); $xmlWriter->writeAttribute('xmlns:ows', 'http://www.opengis.net/ows/1.1'); $xmlWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); $xmlWriter->writeAttribute('xsi:schemaLocation', 'http://www.opengis.net/ows/1.1 https://demo.boundlessgeo.com/geoserver/schemas/ows/1.1.0/owsAll.xsd'); $xmlWriter->writeAttribute('version', '1.1.0'); $xmlWriter->startElement('ows:Exception'); { if ($this->wfsCode) $xmlWriter->writeAttribute('exceptionCode', $this->wfsCode); if ($this->wfsLocator) $xmlWriter->writeAttribute('locator', $this->wfsLocator); $xmlWriter->startElement('ows:ExceptionText'); { $xmlWriter->text($this->message); } $xmlWriter->endElement();// ows:ExceptionText } $xmlWriter->endElement();// ows:Exception } $xmlWriter->endElement();// ows:ExceptionReport $xmlWriter->endDocument(); return $xmlWriter->outputMemory(true); } public function sendResponseXml() { header('Content-type: application/xml'); echo $this->generateResponseXml(); } }