« Return to Thread: xmlrpc Failed to parse response

xmlrpc Failed to parse response

by Waigani :: Rate this Message:

Reply to Author | View in Thread

Hi, My xmlrpc client returns 'Failed to parse response', even though the logs from the server look correct.

On the client side $conn->getLastResponse()->__toString() returns the following:

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><params><value><nil/></value></params></methodResponse>

Client, Server and logs below.


// Server

$server = new Zend_XmlRpc_Server();
$server->setClass('Hs_Service', 'service');
$response = $server->handle();
$request  = $server->getRequest();

        $path = Zend_Registry::get('pathToFramework');
  $log = new Zend_Log(new Zend_Log_Writer_Stream($path . '_tmp/xmlrpc.log'));
   
$log->info("Incoming request:\n" . $request->saveXML() .
"\nResponse:\n" . $response);

echo $response;


//Client

$conn  = new Hs_XmlRpc_Client('…');

        try {
            $result = $conn->call('service.hello');
            echo $result, "\n\n";
        } catch (Zend_XmlRpc_Exception $e) {
            echo $e->getMessage() . "\n\n";
        }
        echo $conn->getLastResponse()->__toString();

//logs

2008-06-19T14:20:18+12:00 INFO (6): Incoming request:
<?xml version="1.0" encoding="UTF-8"?>
<methodCall><methodName>service.hello</methodName></methodCall>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse><params><value><string>hello</string></value></params></methodResponse>

Any ideas?

 « Return to Thread: xmlrpc Failed to parse response

LightInTheBox - Buy quality products at wholesale price!