fault = new Fault(630); return; } $this->xml = $xml; $this->loadXml($xml); } /** * Retrieve the raw XML request * * @return string */ public function getRawRequest() { return $this->xml; } /** * Get headers * * Gets all headers as key => value pairs and returns them. * * @return array */ public function getHeaders() { if (null === $this->headers) { $this->headers = array(); foreach ($_SERVER as $key => $value) { if ('HTTP_' == substr($key, 0, 5)) { $header = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($key, 5))))); $this->headers[$header] = $value; } } } return $this->headers; } /** * Retrieve the full HTTP request, including headers and XML * * @return string */ public function getFullRequest() { $request = ''; foreach ($this->getHeaders() as $key => $value) { $request .= $key . ': ' . $value . "\n"; } $request .= $this->xml; return $request; } }