MyApp - sample JSON-RPC server class
This module is a smple code (for Perl 5.6 or later). Please check the source.
Takes a scalar and returns it as is.
Returns the current time.
Takes two numbers and returns the total.
sum : Number(a:num, b:num)
The two numbers are automatically set into 'a' and 'b'.
sum2 : Public
This routine is a sample for both JSONRPC 1.1 and 1.0
Same as sum3 but its format is difference.
sum3 : String(a, b)
This is a private procedure, so client can't call this.
sum4 : Private
This is a reserved procedure returns a Service Description object.
Service Description
See to http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html#ServiceDescription.
If you change the name into allowable_procedure, clients are able to call echo and sum only.
allowable_procedure
echo
sum
allowable_procedure is a special name and the method returns a hash reference contains procedure names and its code reference.
sub allowable_procedure { return { echo => \&echo, sum => \&sum, }; }
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
Copyright 2008 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
3 POD Errors
The following errors were encountered while parsing the POD:
=back doesn't take any parameters, but you said =back MyApp::system::describe
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install JSON::RPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::RPC
CPAN shell
perl -MCPAN -e shell install JSON::RPC
For more information on module installation, please visit the detailed CPAN module installation guide.