add' => array
(
'function' => 'plgXMLRPCFoobarServices::add',
'docstring' => 'Adds two numbers.',
'signature' => array(array($xmlrpcStruct, $xmlrpcDouble,
$xmlrpcDouble))
),
// subtraction service
'foobar.subtract' => array
(
'function' => 'plgXMLRPCFoobarServices::subtract',
'docstring' => 'Multiplies two numbers.',
'signature' => array(array($xmlrpcStruct, $xmlrpcDouble,
$xmlrpcDouble))
)
);
}
This example is a little busy, and what it is doing is less than obvious! So let's break it
! down into its component parts. The first thing that we do in the plgXMLRPCFoobar()
function is to declare a bunch of variables global.
We described these variables in the tables about XML-RPC data types. There is one
addition to this list, $xmlrpcValue; this variable is used to encapsulate all other data
types. This is an example of an integer in an XML-RPC document:
666Technically, we do not have to use the type variables because they are
only strings. For example, the value of $xmlrpcDouble is double.
Pages:
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418