[phpxmlrpc] Producing a struct with XML_RPC_Value?
giunta.gaetano at gmail.com
Fri Sep 10 00:54:54 CEST 2010
Jonas Petersson wrote:
> Dear phpxmlrpc gurus,
> May I ask for you advice? I'm trying to produce a request like this one:
> <?xml version="1.0"?>
> ...from php (the above comes from a perl script). However, I can't
> figure out how to massage my params variable to produce this. Here is
> one of my recent tries...
> $params = array(new XML_RPC_Value("HELP", "string"),
> array(new XML_RPC_VALUE("rpc_key") =>
> new XML_RPC_Value("MYSECRETKEY", "string")));
$params = array( new XML_RPC_Value(array(new XML_RPC_Value("HELP", "string"),
array(new XML_RPC_VALUE("rpc_key") =>
new XML_RPC_Value("MYSECRETKEY", "string"))), 'struct' ) );
or something to that effect: an array containing 1 single param, of type struct
> $msg = new XML_RPC_Message('help', $params);
> $cli = new XML_RPC_Client('/xmlrpc','http://www.upcdatabase.com');
> $resp = $cli->send($msg);
> As you can guess, this fails miserably. Presumably I'm doing something
> very stupid, being a novice on this.
> Many thanks in advance / Jonas
> PS. Yes I'm using the upc database and they just adjusted their API to
> require this rpc_key - previously it worked fine being open to the world.
> phpxmlrpc mailing list
> phpxmlrpc at lists.usefulinc.com
More information about the phpxmlrpc