Hi Everyone,
I’m having a problem sending an xmlrpc call to an external php server.
System:
Drupal 5.3 || PHP 5.1.6 || Apache2.2.3 ||PostgreSQL 8.2.4 || XML-RPC v.1.1 (imported lib)
Scenario:
- 3 variables get posted via a subscription form (option, name, email) to a page.
- The page sends an xmlrpc call to the php server to check DB and gets a response
- Based on the response users become subscribers or the form gets redisplayed.
the problem:
the ‘xmlrpcval’ is not building the array of values appropriately and as a result I’m getting and empty array and nil ‘mytype’.
Object ( [me] => Array ( ) [mytype] => 0 )
Code:
///////////////////////////////
function get_vars () {
// sort out vars…
}
function subscribe ($vars) {
foreach ( $vars as $key => $val ) {
$xml_param_array[$key] = new xmlrpcval($val);
}
$msg = new xmlrpcmsg(“mailings.subscribe", array(new xmlrpcval($xml_param_array, "struct")));
$client = new xmlrpc_client("/mail-dir/mailings.php", XMLRPC_SERVER, XMLRPC_PORT);
$response = $client->send($msg, 40, XMLRPC_PROTOCOL);
$v = xmlrpc_decode($response->value());
return $v;
}
///////////////////////////////
Current situation:
As I have imported the standard xml-rpc for php library rather than Drupal’s, I have also tried v.2.2 but no luck.