Zend\XmlRpc\Server
An XML-RPC server implementation
Example:
<code>
use Zend\XmlRpc;
// Instantiate server
$server = new XmlRpc\Server();
// Allow some exceptions to report as fault responses:
XmlRpc\Server\Fault::attachFaultException('My\\Exception');
XmlRpc\Server\Fault::attachObserver('My\\Fault\\Observer');
// Get or build dispatch table:
if (!XmlRpc\Server\Cache::get($filename, $server)) {
// Attach Some_Service_Class in 'some' namespace
$server->setClass('Some\\Service\\Class', 'some');
// Attach Another_Service_Class in 'another' namespace
$server->setClass('Another\\Service\\Class', 'another');
// Create dispatch table cache file
XmlRpc\Server\Cache::save($filename, $server);
}
$response = $server->handle();
echo $response;
</code>
Synopsis
class Server
extends AbstractServer
{
- // members
- protected string $encoding;
- protected null|Request $request;
- protected string $responseClass;
- protected Definition $table;
- protected array $typeMap;
- protected bool $sendArgumentsToAllMethods;
- protected bool $returnResponse;
- protected Response $response;
- // Inherited members from AbstractServer
- protected bool $overwriteExistingMethods;
- protected Definition $table;
- // methods
- public void __construct()
- public mixed __call()
- public void addFunction()
- public void setClass()
- public Fault fault()
- public Server setReturnResponse()
- public bool getReturnResponse()
- public Response|Fault handle()
- public void loadFunctions()
- public Server setEncoding()
- public string getEncoding()
- public void setPersistence()
- public Server setRequest()
- public null|Request getRequest()
- public Response getResponse()
- public bool setResponseClass()
- public string getResponseClass()
- public array getDispatchTable()
- public array getFunctions()
- public System getSystem()
- public void sendArgumentsToAllMethods()
- protected string _fixType()
- protected Response handleRequest()
- protected void registerSystemMethods()
- protected static bool isSubclassOf()
- // Inherited methods from AbstractServer
- public void __construct()
- public Definition getFunctions()
- protected Callback _buildCallback()
- protected Definition _buildSignature()
- protected mixed _dispatch()
- protected abstract string _fixType()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
101+ | Determine how to implement this |
Members
protected
- $encoding
—
string
Character encoding - $overwriteExistingMethods — Zend\Server\bool
- $request
—
Zend\XmlRpc\null|Request
Request processed - $response
—
Zend\XmlRpc\Response
Last response results. - $responseClass
—
string
Class to use for responses; defaults to {@link Response\Http} - $returnResponse
—
Zend\XmlRpc\bool
Flag: whether or not {@link handle()} should return a response instead of automatically emitting it. - $sendArgumentsToAllMethods
—
Zend\XmlRpc\bool
Send arguments to all methods or just constructor? - $table
—
Zend\Server\Definition
Dispatch table of name => method pairs - $table — Zend\Server\Definition
- $typeMap
—
array
PHP types => XML-RPC types
Methods
protected
- _fixType() — Map PHP type to XML-RPC type
- handleRequest() — Handle an xmlrpc call (actual work)
- isSubclassOf() — Checks if the object has this class as one of its parents
- registerSystemMethods() — Register system methods with the server
public
- __construct() — Constructor
- __call() — Proxy calls to system object
- addFunction() — Attach a callback as an XMLRPC method
- fault() — Raise an xmlrpc server fault
- getDispatchTable() — Retrieve dispatch table
- getEncoding() — Retrieve current encoding
- getFunctions() — Returns a list of registered methods
- getRequest() — Return currently registered request object
- getResponse() — Last response.
- getResponseClass() — Retrieve current response class
- getReturnResponse() — Retrieve return response flag
- getSystem() — Retrieve system object
- handle() — Handle an xmlrpc call
- loadFunctions() — Load methods as returned from {@link getFunctions}
- sendArgumentsToAllMethods() — Send arguments to all methods?
- setClass() — Attach class methods as XMLRPC method handlers
- setEncoding() — Set encoding
- setPersistence() — Do nothing; persistence is handled via {@link Zend\XmlRpc\Server\Cache}
- setRequest() — Set the request object
- setResponseClass() — Set the class to use for the response
- setReturnResponse() — Set return response flag
Inherited from Zend\Server\AbstractServer
protected
- _buildCallback() — Build callback for method signature
- _buildSignature() — Build a method signature
- _dispatch() — Dispatch method
- _fixType() — Map PHP type to protocol type
public
- getFunctions() — Returns a list of registered methods