3 * Helper function for the terminally lazy
5 * @copyright (c) 2006-2014 G. Giunta
6 * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
10 * Takes a client object, a remote method name, and a variable numbers of
11 * php values, and calls the method with the supplied parameters. The
12 * parameters are native php values and the result is an xmlrpcresp object.
15 * The function encodes the received parameters using php_xmlrpc_encode:
16 * the limitations of automatic encoding apply to this function too);
18 * the type of the value returned by the function can be changed setting
19 * beforehand the 'return_type' member of the client object to 'phpvals' -
20 * see the manual for more details about this capability).
25 * @param xmlrpc_client client object, properly set up to connect to server
26 * @param string remote function name
27 * @param mixed $parameter1
28 * @param mixed $parameter2
29 * @param mixed $parameter3 ...
30 * @return xmlrpcresp or false on error
32 function xmlrpccall_simple()
34 if(func_num_args() < 2)
41 $varargs = func_get_args();
42 $client = array_shift($varargs);
43 $remote_function_name = array_shift($varargs);
44 if (!is_a($client, 'xmlrpc_client') || !is_string($remote_function_name))
49 $xmlrpcval_array = array();
50 foreach($varargs as $parameter)
52 $xmlrpcval_array[] = php_xmlrpc_encode($parameter);
55 return $client->send(new xmlrpcmsg($remote_function_name, $xmlrpcval_array));