## Class mr_server_response_abstract

Description

MR Server Response Abstract

This class is responsible for generating the response body for a particular service. The reason to have a separate class to handle responses is so that a single service could be paired with different response classes at different endpoints. So, same functioning service but different customized responses.

- author: Mark Nielsen
- abstract:
- example: Example usage with the server
- example: Example class definition

Located in /server/response/abstract.php (line 46)

Variable Summary
mr_server_abstract $server
string $serviceclass
string $servicemethod
Method Summary
mr_server_response_abstract __construct (mr_server_abstract $server, string $serviceclass)
void array_to_dom (array|object $array, DOMDocument $dom, DOMElement|DOMNodeList $parent)
mixed fault (string $message)
void init ()
DOMDocument new_dom ()
string post_handle (string $response)
void send_headers (Zend_Server_* $server)
DOMDocument standard ([mixed $response = NULL], [boolean $status = true])
DOMDocument __call (string $name, array $arguments)
Variables
mr_server_abstract $server (line 52)

The server

- access: protected

string $serviceclass (line 59)

The service class name

- access: protected

string $servicemethod (line 66)

The service class method name

- access: protected

Methods
Constructor __construct (line 74)

Constructor

- access: public

mr_server_response_abstract __construct (mr_server_abstract $server, string $serviceclass)

- mr_server_abstract $server: The current server model
- string $serviceclass: The web service class

array_to_dom (line 201)

Converts an array into DOMDocument

- access: protected

void array_to_dom (array|object $array, DOMDocument $dom, DOMElement|DOMNodeList $parent)

- array|object $array: The array to convert
- DOMDocument $dom: The document
- DOMElement|DOMNodeList $parent: Parent element in the $dom

fault (line 123)

Server fault response (Return false to use Zend Server's)

- access: public

mixed fault (string $message)

- string $message: Reason for the fault

init (line 94)

Constructor hook

- access: protected

void init ()
new_dom (line 102)

Generate default DOM structure

- access: public

DOMDocument new_dom ()
post_handle (line 136)

View the response returned by Zend Server

This gives the response class to map any Zend Server faults to its own.

- access: public

string post_handle (string $response)

- string $response: Response XML

send_headers (line 146)

Send server headers

- access: public

void send_headers (Zend_Server_* $server)

- Zend_Server_* $server: object

standard (line 171)

Standard response structure

- access: public

DOMDocument standard ([mixed $response = NULL], [boolean $status = true])

- mixed $response: An array or string of response data
- boolean $status: Web service request status

__call (line 233)

Handle undefined method calls

- throws: coding_exception
- access: public

DOMDocument __call (string $name, array $arguments)

- string $name: Method name
- array $arguments: Method args

Documentation generated on Thu, 28 Jun 2012 16:33:45 -0700 by phpDocumentor 1.4.3