[phpxmlrpc] question about xmlrpcval
Gaetano Giunta
giunta.gaetano at gmail.com
Mon Aug 10 09:55:35 CEST 2009
Donato Molino wrote:
> Hello,
>
> I would like to set in a xmlrpc client an instructions as follow:
>
> $M=count($array);
>
> foreach ($elements as $key => $val) {
> for ($d = 0; $d < $M; $d++) {
> $VET[$key][$d] = new xmlrpcval($_POST[$key][$d], 'string');
> }
> }
>
You are missing an encoding level here: $VET is an array-of-arrays, ans
as such cannot be simply encoded later on
$VET = array();
foreach ($elements as $key => $val) {
$arr = array();
for ($d = 0; $d < $M; $d++) {
$arr[$d] = new xmlrpcval($_POST[$key][$d], 'string');
}
$VET[$key] = new xmlrpcval($arr, 'array');
}
You could also try out the easier way to encode: php_xmlrpc_encode() ...
Ciao
Gaetano
> and then:
>
> $ve=new xmlrpcval( array (
> "user" => new xmlrpcval($userid, 'int'),
> "VET" => new xmlrpcval($VET, 'struct'),
> ), 'struct' );
>
> But it fails.
>
> The server method signature is:
>
> $DoInsert_sig=array(array($xmlrpcStruct, $xmlrpcStruct));
>
> Any help would be greatly appreciated.
>
> Donato
> _______________________________________________
> phpxmlrpc mailing list
> phpxmlrpc at lists.usefulinc.com
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
>
>
More information about the phpxmlrpc
mailing list