xmlrpccall_simple

Takes a client object, a remote method name, and a variable numbers of php values, and calls the method with the supplied parameters.

Description

xmlrpccall_simple(); 

The parameters are native php values and the result is an xmlrpcresp object.

Notes: The function encodes the received parameters using php_xmlrpc_encode: the limitations of automatic encoding apply to this function too);

the type of the value returned by the function can be changed setting beforehand the return_type member of the client object to phpvals - see the manual for more details about this capability).


Usage

  1. if ( !function_exists( 'xmlrpccall_simple' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7-infusionsoft-add-on/src/xmlrpc-3.0/demo/client/simple_call.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = xmlrpccall_simple(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/src/xmlrpc-3.0/demo/client/simple_call.php  
  1. function xmlrpccall_simple() 
  2. if(func_num_args() < 2) 
  3. // Incorrect 
  4. return false; 
  5. else 
  6. $varargs = func_get_args(); 
  7. $client = array_shift($varargs); 
  8. $remote_function_name = array_shift($varargs); 
  9. if (!is_a($client, 'xmlrpc_client') || !is_string($remote_function_name)) 
  10. return false; 
  11.  
  12. $xmlrpcval_array = array(); 
  13. foreach($varargs as $parameter) 
  14. $xmlrpcval_array[] = php_xmlrpc_encode($parameter); 
  15.  
  16. return $client->send(new xmlrpcmsg($remote_function_name, $xmlrpcval_array));