Bug #14521 Updated: XMLRPC extension: wrong results?
| From: | danda@php.net | Date: | Tue, 18 Dec 2001 19:35:52 +0000 |
| Subject: | Bug #14521 Updated: XMLRPC extension: wrong results? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-74305@lists.php.net to get a copy of this message | ||
ID: 14521
Updated by: danda
Reported By: cmv@php.net
Old Status: Open
Status: Bogus
Bug Type: XMLRPC-EPI related
Operating System: Debian Linux 2.4.6-pre6
PHP Version: 4.1.0
New Comment:
working as designed.
the working as designed.
the $data array he is passing in is actually the xmlrpc top level params list.
If he wishes to pass the array as the first argument (as the receiving method seems to want) then he
should create a wrapper array, eg:
$params = array(array('bob', 'kim'));
Note also that if the receiving function simply prints params instead of the first param, then it
will print the array as passed.$data array he is passing in is actually the xmlrpc top level params
list.
If he wishes to pass the array as the first argument (as the receiving method seems to want) then he
should create a wrapper array, eg:
$params = array(array('bob', 'kim'));
Note also that if the receiving function simply prints params instead of the first param, then it
will print the array as passed.
Previous Comments:
------------------------------------------------------------------------
[2001-12-14 12:51:06] cmv@php.net
[This is a copy of email sent to xmlrpc-epi mailing list, which hasn't been answered yet.]
First off, I'm using PHP 4.1.0 with the built in XMLRPC extension (which I assume is pretty
much the same as what's documented at http://xmlrpc-epi.sourceforge.net/)
I made a simple server which basically echo's back the same params that are passed to it (see
the script below).
It works when I send an integer, or a string, or an associative array. However, it fails on a
non-indexed array.
Am I doing something wrong, or is this a bug in the extension? I hope it's me, because this
extension is pretty damn cool. :)
- Colin
The script:
<?php
function method_echo($method, $params) {
$foo = array_pop($params);
return $foo;
}
/* this is the test data to send */
$data = array('bob','kim');
echo "<h1>Request</h1>";
echo "<xmp>";
var_dump($data);
echo "</xmp>";
$server = xmlrpc_server_create();
xmlrpc_server_register_method($server, 'method_echo', 'method_echo');
$request_xml = xmlrpc_encode_request('method_echo', $data );
$response = xmlrpc_server_call_method($server, $request_xml, NULL,
array(
'output_type' => 'php'
)
);
echo "<h1>Result</h1>";
echo "<xmp>";
var_dump($response);
echo "</xmp>";
xmlrpc_server_destroy($server);
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14521&edit=1