GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  JSONRPC (3)

.ds Aq ’

NAME



 JSONRPC - Perl implementation of JSON-RPC protocol



CONTENTS

SYNOPSIS



 #--------------------------
 # In your application class
 package MyApp;

 sub own_method { # called by clients
     my ($server, @params) = @_; # $server is JSONRPC object.
     ...
     # return a scalar value or a hashref or an arryaref.
 }

 #--------------------------
 # In your main cgi script.
 use JSONRPC::Transport::HTTP;
 use MyApp;

 # a la XMLRPC::Lite
 JSONRPC::Transport::HTTP::CGI->dispatch_to(MyApp)->handle();


 #--------------------------
 # Client version
 use JSONRPC::Transport::HTTP;
 my $uri = http://www.example.com/MyApp/Test/;

 my $res = JSONRPC::Transport::HTTP
            ->proxy($uri)
            ->call(echo,[This is test.])
            ->result;

 if($res->error){
   print $res->error,"\n";
 }
 else{
   print $res->result,"\n";
 }

 # or

 my $client = JSONRPC::Transport::HTTP->proxy($uri);

 print $client->echo(This is test.); # the alias, _echo is same.



TRANSITION PLAN

In the next large update version, JSON and JSONRPC modules are split.



  JSONRPC* and Apache::JSONRPC are deleted from JSON dist.
  JSONRPC::Client, JSONRPC::Server and JSONRPC::Procedure in JSON::RPC dist.

  Modules in JSON::RPC dist supports JSONRPC protocol v1.1 and 1.0.



DESCRIPTION

This module implementes JSON-RPC (<http://json-rpc.org/>) server and client. Most ideas were borrowed from XMLRPC::Lite. Currently JSONRPC provides CGI server function.

METHOD

dispatch_to
handle
jsonParser The accessor of a JSON::Parser object.



 my $srv = JSONRPC::Transport::HTTP::CGI->new;
 $srv->jsonParser->{unmapping} = 1;



jsonConverter The accessor of a JSON::Converter object.
proxy($uri,[$proxy_uri]) takes a service uri and optional proxy uri. returns a client object.

SEE ALSO

JSONRPC::Transport::HTTP JSON XMLRPC::Lite <http://json-rpc.org/>

AUTHOR

Makamaka Hannyaharamitu, <makamaka[at]cpan.org>

COPYRIGHT AND LICENSE

Copyright 2005-2007 by Makamaka Hannyaharamitu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 JSONRPC (3) 2007-05-10

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.