[phpxmlrpc] Invalid payload...

Vincent DELERUE (NETASQ) vincent.delerue at netasq.com
Wed Nov 9 15:43:35 GMT 2005


Hi,

I've a good response xml but xml_rpc can't parse it and give me :"Fault
Code: 2 Fault Reason: Invalid return payload: enable debugging to
examine incoming payload"

on two others server it works but not my production server

have you any suggestion ?

on FreeBSD, install by ports :
php4.4.1
php4-xmlrpc-4.4.1_1
pear-XML_RPC-1.4.3
pear-PEAR-1.3.5_1

Thanks
Vincent

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";
}


ERROR DEBUG :

<?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



More information about the phpxmlrpc mailing list