Remote Procedure Calls with PEAR::XML-RPC - Distributed Function Requirements
(Page 8 of 12 )
While our example only uses one function, an RPC server can essentially host as many functions as its disk space will permit. To help keep things organized each function needs three parts: the function itself, a signature and documentation.
The function's signature is a listing of a function's return and argument types. GetNameLength returns an integer value and accepts two strings, or array("int", "string", "string").
Because a function may have more than one signature, the final definition is an array containing each signature.
<?php $getnamelength_sig = array(array("int", "string", "string")); ?> |
The function's documentation is simply a text string serving to document the function.
<?php $getnamelength_doc = "Accepts two string parameters, joins them and then returns the length of the resulting string."; ?> |
Next: Inside the Function >>
More Miscellaneous Articles
More By bluephoenix