PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » XML_RPC » Bug #7748

XML-RPC 1.4.8 locale error

Details

Submitted2006-05-29 09:57 UTC
Fromtugrulyilmazer at gmail dot com
Assigneddanielc
StatusBogus
PackageXML_RPC
PHP Version4.3.10
OSGNU Debian/Linux
Roadmaps(Not assigned)

Comments

[2006-05-29 09:57 UTC] tugrulyilmazer at gmail dot com

Description:
------------
I couldn't find problem cause. If i write a setlocale(LC_ALL, 'tr_TR'); line at client.php, i have a got a big problem.

Test script:
---------------
client.php:

<?php
require_once 'XML/RPC.php';
setlocale(LC_ALL, 'tr_TR');

$input = 'Mustafa Tugrul';
$params = array(new XML_RPC_Value($input, 'string'));
$msg = new XML_RPC_Message('times2', $params);

$cli = new XML_RPC_Client('/~corporem/phpcalismalar/rpc/server.php', 'localhost');

$resp = $cli->send($msg);
if (!$resp) {
echo 'Communication error: ' . $cli->errstr;
exit;
}

if (!$resp->faultCode()) {
$val = $resp->value();
echo $val->scalarval();
} else {
echo 'Fault Code: ' . $resp->faultCode() . "\n";
echo 'Fault Reason: ' . $resp->faultString() . "\n";
}
?>

server.php:

<?php
require_once 'XML/RPC/Server.php';

class hebele {
function a($params) {
$param = $params->getParam(0);
$a = $param->scalarval();

if (!XML_RPC_Value::isValue($param)) {
return $param;
}
$val = new XML_RPC_Value($a, 'string');
return new XML_RPC_Response($val);
}
}

$server = new XML_RPC_Server(
array('times2' => array('function' => 'hebele::a'))
);
?>

Expected result:
----------------
Warning: in_array(): Wrong datatype for second argument in /usr/share/php/XML/RPC.php on line 269

Fault Code: 2 Fault Reason: Invalid return payload: enable debugging to examine incoming payload xmlrpc element STRÝNG cannot be child of VALUE

Actual result:
--------------
Mustafa Tugrul

[2006-05-29 10:02 UTC] tugrulyilmazer at gmail dot com

Sorry;

Actual result:
--------------

Warning: in_array(): Wrong datatype for second argument in
/usr/share/php/XML/RPC.php on line 269

Fault Code: 2 Fault Reason: Invalid return payload: enable debugging to
examine incoming payload xmlrpc element STRÝNG cannot be child of VALUE

Expected result:
----------------
Mustafa Tugrul

[2006-05-29 14:14 UTC] tugrulyilmazer at gmail dot com

Package: XML_RPC