From:             [EMAIL PROTECTED]
Operating system: Debian Linux 2.4.6-pre6
PHP version:      4.1.0
PHP Bug Type:     *XML functions
Bug description:  XMLRPC extension: wrong results?

[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 bug report at: http://bugs.php.net/?id=14521&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to