PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » XML_RPC » Bug #5919

Invalid payload on good script

Details

Submitted2005-11-10 11:10 UTC
Fromvincent dot delerue at netasq dot com
Assigneddanielc
StatusBogus
PackageXML_RPC
PHP Version4.4.1
OSFreeBSD
Roadmaps(Not assigned)

Comments

[2005-11-10 11:10 UTC] vincent dot delerue at netasq dot com

Description:
------------
Hi, I've a problem on a server (it works on two others server with same config)

see under :

Environment :
on FreeBSD :
php4.4.1
php4-xmlrpc-4.4.1_1
pear-XML_RPC-1.4.3
pear-PEAR-1.3.5_1

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value><string>10</string></value>
</param>
</params>
</methodResponse>
---END---

Fault Code: 2 Fault Reason: Invalid return payload: enable debugging to examine incoming payload

Test script:
---------------
My code :

Server side :
function returnTest($params) {
$param = $params->getParam(0);

// This error checking syntax was added in Release 1.3.0
if (!XML_RPC_Value::isValue($param)) {
return $param;
}

$val = new XML_RPC_Value($param->scalarval(), 'string');
return new XML_RPC_Response($val);
}

Client side :
$params = array(new XML_RPC_Value("10", 'int'));
$msg = new XML_RPC_Message('test', $params);

$cli = new XML_RPC_Client('/xmlrpc.php', "monserver"); $cli->setDebug(1);

$resp = $cli->send($msg);

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

if (!$resp->faultCode()) {
$val = $resp->value();
} else {

// Display problems that have been gracefully cought and
// reported by the xmlrpc.php script.

$ErrMsg .= "VITAL_ERR_COMMUNICATION_ERROR";
echo 'Fault Code: ' . $resp->faultCode() . "\n";
echo 'Fault Reason: ' . $resp->faultString() . "\n";
}

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value><string>10</string></value>
</param>
</params>
</methodResponse>
---END---

Fault Code: 2 Fault Reason: Invalid return payload: enable debugging to examine incoming payload

Actual result:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value><string>10</string></value>
</param>
</params>
</methodResponse>
---END---

Fault Code: 2 Fault Reason: Invalid return payload: enable debugging to examine incoming payload