NAME
RPC::Any::Server::XMLRPC - A basic XML-RPC server
SYNOPSIS
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();
DESCRIPTION
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.
XMLRPC SERVER ATTRIBUTES
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.
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.RPC::Any XMLRPC Servers always understand
nil
if you send it to them. However, your clients may not understandnil
, so this is a boolean that lets you control whether or not RPC::Any::Server::XMLRPC will produce output withnil
in it.When
send_nil
is true, any instance ofundef
or RPC::XML::nil in a method's return value will be converted to<nil>
. Whensend_nil
is false, any instance ofundef
or RPC::XML::nil in a method's return value will be converted to an empty<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.