RPC::Any::Server::XMLRPC - A basic XML-RPC server
use RPC::Any::Server::XMLRPC; # Create a server where calling Foo.bar will call My::Module->bar. my $server = RPC::Any::Server::XMLRPC->new( dispatch => { 'Foo' => 'My::Module' }, send_nil => 0, ); # Read XML from STDIN and print XML result to STDOUT. print $server->handle_input();
This is a server that takes just XML-RPC as input, and produces just XML-RPC as output. It doesn't understand HTTP headers or anything like that, and it doesn't produce HTTP headers. For that, see RPC::Any::Server::XMLRPC::HTTP or RPC::Any::Server::XMLRPC::CGI.
See RPC::Any::Server for a basic description of how servers work in RPC::Any.
Currently, RPC::Any::Server::XMLRPC uses RPC::XML in its backend to parse incoming XML-RPC, and to produce outbound XML-RPC. We do not use the server components of RPC::XML, just the parser.
These are additional attributes beyond what is specified in RPC::Any::Server that are available for an XML-RPC server. These can all be specified during new or set like $server->method($value). They are all optional.
new
$server->method($value)
send_nil
There is an extension to the XML-RPC protocol that specifies an additional type of tag, called <nil>. The extension is specified at http://ontosys.com/xml-rpc/extensions.php.
<nil>
RPC::Any XMLRPC Servers always understand nil if you send it to them. However, your clients may not understand nil, so this is a boolean that lets you control whether or not RPC::Any::Server::XMLRPC will produce output with nil in it.
nil
When send_nil is true, any instance of undef or RPC::XML::nil in a method's return value will be converted to <nil>. When send_nil is false, any instance of undef or RPC::XML::nil in a method's return value will be converted to an empty <string>.
undef
<string>
parser
This is the RPC::XML::Parser instance that RPC::Any::Server:XMLRPC is using internally. Usually you will not have to modify this.
To install RPC::Any, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RPC::Any
CPAN shell
perl -MCPAN -e shell install RPC::Any
For more information on module installation, please visit the detailed CPAN module installation guide.