PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TJsonRpcProtocol

TJsonRpcProtocol class

TJsonRpcProtocol is a class that implements JSON-Rpc protocol in 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.

TRpcProtocol
Extended by TJsonRpcProtocol
Package: System\Web\Services
Copyright: 2010 Bigpoint GmbH
License: http://www.pradosoft.com/license/
Author: Robin J. Rogge <rrogge@bigpoint.net>
Author: Fabio Bas <ctrlaltca@gmail.com>
Version: $Id$
Since: 3.2
Located at Web/Services/TRpcService.php
Methods summary
public string
# callMethod( string $requestPayload )

Handles the RPC request

Handles the RPC request

Parameters

$requestPayload
string
$requestPayload

Returns

string
JSON RPC response
public string
# createErrorResponse( TRpcException $exception )

Turns the given exception into an JSON RPC fault

Turns the given exception into an JSON RPC fault

Parameters

$exception
TRpcException
$exception

Returns

string
JSON RPC fault
public
# createResponseHeaders( THttpResponse $response )

Sets the correct response headers

Sets the correct response headers

Parameters

$response
THttpResponse
$response
public array
# decode( string $data )

Decodes JSON encoded data into PHP data

Decodes JSON encoded data into PHP data

Parameters

$data
string
$data in JSON format

Returns

array
PHP data
public string
# encode( mixed $data )

Encodes PHP data into JSON data

Encodes PHP data into JSON data

Parameters

$data
mixed
PHP data

Returns

string
JSON encoded PHP data
public mixed
# callApiMethod( string $methodName, array $parameters )

Calls the callback handler for the given method Overrides parent implementation to correctly handle error codes

Calls the callback handler for the given method Overrides parent implementation to correctly handle error codes

Parameters

$methodName
string
$methodName of the RPC
$parameters
array
$parameters for the callback handler as provided by the client

Returns

mixed
whatever the callback handler returns

Overrides

TRpcProtocol::callApiMethod()
Methods inherited from TRpcProtocol
addMethod()
Properties summary
protected mixed $_id null
#
protected float $_specificationVersion 1.0
#
Properties inherited from TRpcProtocol
$rpcMethods
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO