|
|
@@ -6,7 +6,7 @@
|
|
|
<sect2 id="zend.xmlrpc.server.introduction">
|
|
|
<title>Introduction</title>
|
|
|
|
|
|
- <para><classname>Zend_XmlRpc_Server</classname> is intended as a fully-featured <acronym>XML</acronym>-RPC
|
|
|
+ <para><classname>Zend_XmlRpc_Server</classname> is intended as a fully-featured XML-RPC
|
|
|
server,
|
|
|
following <ulink url="http://www.xmlrpc.com/spec">the specifications
|
|
|
outlined at www.xmlrpc.com</ulink>. Additionally, it implements the
|
|
|
@@ -56,7 +56,7 @@ echo $server->handle();
|
|
|
requested. It then returns either a
|
|
|
<classname>Zend_XmlRpc_Response</classname>-based object or a
|
|
|
<classname>Zend_XmlRpc_Server_Fault</classname>object. These objects both have
|
|
|
- <methodname>__toString()</methodname> methods that create valid <acronym>XML</acronym>-RPC <acronym>XML</acronym>
|
|
|
+ <methodname>__toString()</methodname> methods that create valid XML-RPC <acronym>XML</acronym>
|
|
|
responses, allowing them to be directly echoed.
|
|
|
</para>
|
|
|
</sect2>
|
|
|
@@ -65,18 +65,18 @@ echo $server->handle();
|
|
|
<title>Conventions</title>
|
|
|
<para>
|
|
|
<classname>Zend_XmlRpc_Server</classname> allows the developer to attach functions and
|
|
|
- class method calls as dispatchable <acronym>XML</acronym>-RPC methods. Via
|
|
|
+ class method calls as dispatchable XML-RPC methods. Via
|
|
|
<classname>Zend_Server_Reflection</classname>, it does introspection on all attached
|
|
|
methods, using the function and method docblocks to determine the
|
|
|
method help text and method signatures.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- <acronym>XML</acronym>-RPC types do not necessarily map one-to-one to <acronym>PHP</acronym> types.
|
|
|
+ XML-RPC types do not necessarily map one-to-one to <acronym>PHP</acronym> types.
|
|
|
However, the code will do its best to guess the appropriate type
|
|
|
- based on the values listed in @param and @return lines. Some <acronym>XML</acronym>-RPC
|
|
|
+ based on the values listed in @param and @return lines. Some XML-RPC
|
|
|
types have no immediate <acronym>PHP</acronym> equivalent, however, and should be
|
|
|
- hinted using the <acronym>XML</acronym>-RPC type in the <acronym>PHP</acronym>Doc. These include:
|
|
|
+ hinted using the XML-RPC type in the PHPDoc. These include:
|
|
|
</para>
|
|
|
|
|
|
<itemizedlist>
|
|
|
@@ -113,7 +113,7 @@ function myFunc($val1, $val2, $val3)
|
|
|
|
|
|
<para>
|
|
|
It is perfectly valid to specify multiple types for both params and
|
|
|
- return values; the <acronym>XML</acronym>-RPC specification even suggests that
|
|
|
+ return values; the XML-RPC specification even suggests that
|
|
|
system.methodSignature should return an array of all possible method
|
|
|
signatures (i.e., all possible combinations of param and return
|
|
|
values). You may do so just as you normally would with
|
|
|
@@ -137,7 +137,7 @@ function myFunc($val1, $val2, $val3)
|
|
|
<para>
|
|
|
One note, however: allowing multiple signatures can lead to
|
|
|
confusion for developers using the services; generally speaking, an
|
|
|
- <acronym>XML</acronym>-RPC method should only have a single signature.
|
|
|
+ XML-RPC method should only have a single signature.
|
|
|
</para>
|
|
|
</sect2>
|
|
|
|
|
|
@@ -145,10 +145,10 @@ function myFunc($val1, $val2, $val3)
|
|
|
<title>Utilizing Namespaces</title>
|
|
|
|
|
|
<para>
|
|
|
- <acronym>XML</acronym>-RPC has a concept of namespacing; basically, it allows grouping
|
|
|
- <acronym>XML</acronym>-RPC methods by dot-delimited namespaces. This helps prevent
|
|
|
+ XML-RPC has a concept of namespacing; basically, it allows grouping
|
|
|
+ XML-RPC methods by dot-delimited namespaces. This helps prevent
|
|
|
naming collisions between methods served by different classes. As an
|
|
|
- example, the <acronym>XML</acronym>-RPC server is expected to server several methods in
|
|
|
+ example, the XML-RPC server is expected to server several methods in
|
|
|
the 'system' namespace:
|
|
|
</para>
|
|
|
|
|
|
@@ -186,11 +186,11 @@ $server->addFunction('somefunc', 'funcs');
|
|
|
Most of the time, you'll simply use the default request type included with
|
|
|
<classname>Zend_XmlRpc_Server</classname>,
|
|
|
<classname>Zend_XmlRpc_Request_Http</classname>. However, there may be times when you
|
|
|
- need <acronym>XML</acronym>-RPC to be available via the CLI, a GUI, or other environment, or want to log
|
|
|
+ need XML-RPC to be available via the CLI, a GUI, or other environment, or want to log
|
|
|
incoming requests. To do so, you may create a custom request object that extends
|
|
|
<classname>Zend_XmlRpc_Request</classname>. The most important thing to remember is to
|
|
|
ensure that the getMethod() and getParams() methods are implemented
|
|
|
- so that the <acronym>XML</acronym>-RPC server can retrieve that information in order to
|
|
|
+ so that the XML-RPC server can retrieve that information in order to
|
|
|
dispatch the request.
|
|
|
</para>
|
|
|
</sect2>
|
|
|
@@ -202,7 +202,7 @@ $server->addFunction('somefunc', 'funcs');
|
|
|
Similar to request objects, <classname>Zend_XmlRpc_Server</classname> can return custom
|
|
|
response objects; by default, a <classname>Zend_XmlRpc_Response_Http</classname> object
|
|
|
is returned, which sends an appropriate Content-Type <acronym>HTTP</acronym> header for
|
|
|
- use with <acronym>XML</acronym>-RPC. Possible uses of a custom object would be to log
|
|
|
+ use with XML-RPC. Possible uses of a custom object would be to log
|
|
|
responses, or to send responses back to STDOUT.
|
|
|
</para>
|
|
|
|
|
|
@@ -218,7 +218,7 @@ $server->addFunction('somefunc', 'funcs');
|
|
|
|
|
|
<para>
|
|
|
<classname>Zend_XmlRpc_Server</classname> catches Exceptions generated by a dispatched
|
|
|
- method, and generates an <acronym>XML</acronym>-RPC fault response when such an
|
|
|
+ method, and generates an XML-RPC fault response when such an
|
|
|
exception is caught. By default, however, the exception messages and
|
|
|
codes are not used in a fault response. This is an intentional
|
|
|
decision to protect your code; many exceptions expose more
|
|
|
@@ -254,7 +254,7 @@ Zend_XmlRpc_Server_Fault::attachFaultException('My_Project_Exception');
|
|
|
<sect2 id="zend.xmlrpc.server.caching">
|
|
|
<title>Caching Server Definitions Between Requests</title>
|
|
|
<para>
|
|
|
- Attaching many classes to an <acronym>XML</acronym>-RPC server instance can utilize a
|
|
|
+ Attaching many classes to an XML-RPC server instance can utilize a
|
|
|
lot of resources; each class must introspect using the Reflection
|
|
|
<acronym>API</acronym> (via <classname>Zend_Server_Reflection</classname>), which in turn generates a list
|
|
|
of all possible method signatures to provide to the server class.
|
|
|
@@ -310,7 +310,7 @@ echo $server->handle();
|
|
|
<title>Basic Usage</title>
|
|
|
|
|
|
<para>
|
|
|
- The example below attaches a function as a dispatchable <acronym>XML</acronym>-RPC
|
|
|
+ The example below attaches a function as a dispatchable XML-RPC
|
|
|
method and handles incoming calls.
|
|
|
</para>
|
|
|
|
|
|
@@ -337,7 +337,7 @@ echo $server->handle();
|
|
|
|
|
|
<para>
|
|
|
The example below illustrates attaching a class' public methods
|
|
|
- as dispatchable <acronym>XML</acronym>-RPC methods.
|
|
|
+ as dispatchable XML-RPC methods.
|
|
|
</para>
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|