PHP JSON-RPC 2.0 Server/Client Implementation
PHP JSON-RPC 2.0 Server/Client Implementation with Automatic Client Class Generation via SMD
SMD Schema available via /server.php?smd
Public Namespace
new BaseJsonRpcServer( $instance );
$server->Execute();
Multiple Namespaces
new BaseJsonRpcServer();
$server->RegisterInstance( $instance, $namespace )
as many times as you need$server->Execute();
php JsonRpcClientGenerator.php <smd-file> <class-name>
$client = <class-name>::GetInstance(<url>);
try {
$result = $client->Method();
} catch (BaseJsonRpcException $e) {
// work with exception
}
RpcClient.php
$client = RpcClient::GetInstance(<url>);
try {
$result = $client->Method();
} catch (BaseJsonRpcException $e) {
// work with exception
}
php SmdToSwaggerConverter.php 'http://eazyjsonrpc/tests/example-server.php?smd' eazyjsonrpc ../doc/swagger.json