POE::Filter::XML::RPC::Response - An abstracted XMLRPC response
use 5.010; use POE::Filter::XML::RPC::Response; use POE::Filter::XML::RPC::Value; my $response = POE::Filter::XML::RPC::Response->new ( POE::Filter::XML::RPC::Value->new('Okay!'); ) say $response->return_value()->value() # Okay!
POE::Filter::XML::RPC::Reponse provides a simple class for generating XMLRPC responses.
new() takes a single argument that can either be a POE::Filter::XML::RPC::Value object or it can be a POE::Filter::XML::RPC::Fault object.
If the response contains a Fault object, it will be returned. May also take a single argument of another Fault object. In that case, any previous Fault object will be replaced with the provided. Also, if the response contained a valid return Value, it will be replaced by the Fault.
If the response contains a return Value, it will be returned. May also take a single argument of another Value object. In that case, any previous Value object will be replaced with the provided. Also, if the response contained a Fault, it will be replaced by the Value.
Response is actually a subclass of POE::Filter::XML::Node and so all of its methods, including XML::LibXML::Element's, are available for use. This could ultimately be useful to avoid marshalling all of the data out of the Node and instead apply an XPATH expression to target specifically what is desired deep within a nested structure.
Copyright 2009 Nicholas Perez. Licensed and distributed under the GPL.
To install POE::Filter::XML::RPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Filter::XML::RPC
CPAN shell
perl -MCPAN -e shell install POE::Filter::XML::RPC
For more information on module installation, please visit the detailed CPAN module installation guide.