TR : Pear XML RPC problem
| From: | NETASQ) | Date: | Thu, 10 Nov 2005 13:17:06 +0000 |
| Subject: | TR : Pear XML RPC problem | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-21868@lists.php.net to get a copy of this message | ||
> > Hi guys,
> >
> > Sorry if it not in this list that we can send problem but I've a ig
> > one on my production server that a I cant' reproduce it on
> dev servers
> > (2
> > ones)
> >
> > Code that I give you works on my dev server..
> > Perhaps it miss a library mais I don't know which ?
> >
> > Thanks a lot for your help.
> > Vincent
> >
> > In fact :
> > Environment :
> > on FreeBSD :
> > php4.4.1
> > php4-xmlrpc-4.4.1_1
> > pear-XML_RPC-1.4.3
> > pear-PEAR-1.3.5_1
> >
> >
> > I send a test by pear xml rpc And the debug told me :
> > 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
> >
> >
> > when I check, I see the $resp is empty !
> >
> > 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";
> > }