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