I am learning phprpc Remote Call, follow the online tutorial, found the error: Incorrect response ID (Request ID:1, Response ID:) n; good tangle, ask for advice. The post code is as follows:
service side, member.php
<?php
require_once ' jsonrpcserver.php ';
/**
User:administrator
DATE:2015/12/28
time:11:06
*/
class member
{
Public function GetName ()
{return ' hello word ';//return string}
}
//Service-side call
$myExample = new Member ();
//Injection Instance
Jsonrpcserver::handle ($myExample) or print ' no request ';
Client: client.php
<?php
/**
User:administrator
DATE:2015/12/28
time:11:07*/require_once ' jsonrpcclient.php ';//$url = ' http://localhost/phprpc/server.php '; $url = ' http:// Localhost/phprpc/member.php '; $myExample = new Jsonrpcclient ($url); Echo ';p rint_r ($myExample);//Client call
Try
{
$name = $myExample->getname ();
echo $name;
} catch (Exception $e)
{
Echo nl2br ($e->getmessage ()). '
'. "N";
}
PHPRPC Remote Call error, do not know what reason