PHP Класс Prado\Web\Services\TJsonRpcProtocol

TJsonRpcProtocol is a class that implements JSON-Rpc protocol in {@link TRpcService}. Both version 1.0 and 2.0 of the specification are implemented, and the server will try to answer using the same version of the protocol used by the requesting client.
С версии: 3.2
Автор: Robin J. Rogge ([email protected])
Автор: Fabio Bas ([email protected])
Наследование: extends TRpcProtocol
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_id
$_specificationVersion

Открытые методы

Метод Описание
callApiMethod ( string $methodName, array $parameters ) : mixed Calls the callback handler for the given method Overrides parent implementation to correctly handle error codes
callMethod ( string $requestPayload ) : string Handles the RPC request
createErrorResponse ( TRpcException $exception ) : string Turns the given exception into an JSON RPC fault
createResponseHeaders ( THttpResponse $response ) Sets the correct response headers
decode ( string $data ) : array Decodes JSON encoded data into PHP data
encode ( $data ) : string Encodes PHP data into JSON data

Приватные методы

Метод Описание
checkJsonError ( )

Описание методов

callApiMethod() публичный метод

Calls the callback handler for the given method Overrides parent implementation to correctly handle error codes
public callApiMethod ( string $methodName, array $parameters ) : mixed
$methodName string of the RPC
$parameters array for the callback handler as provided by the client
Результат mixed whatever the callback handler returns

callMethod() публичный метод

Handles the RPC request
public callMethod ( string $requestPayload ) : string
$requestPayload string
Результат string JSON RPC response

createErrorResponse() публичный метод

Turns the given exception into an JSON RPC fault
public createErrorResponse ( TRpcException $exception ) : string
$exception TRpcException
Результат string JSON RPC fault

createResponseHeaders() публичный метод

Sets the correct response headers
public createResponseHeaders ( THttpResponse $response )
$response THttpResponse

decode() публичный метод

Decodes JSON encoded data into PHP data
public decode ( string $data ) : array
$data string in JSON format
Результат array PHP data

encode() публичный метод

Encodes PHP data into JSON data
public encode ( $data ) : string
Результат string JSON encoded PHP data

Описание свойств

$_id защищенное свойство

protected $_id

$_specificationVersion защищенное свойство

protected $_specificationVersion