Protocol::XMLRPC::MethodResponse - XML-RPC methodResponse response
my $method_response = Protocol::XMLRPC::MethodResponse->new; $method_response->param(1); $method_response = Protocol::XMLRPC::MethodResponse->parse(...);
XML-RPC methodResponse response object.
param
Hold method response parameter as object.
new
Creates a new Protocol::XMLRPC::MethodResponse instance.
new_fault
my $method_response = Protocol::XMLRPC::MethodResponse->new_fault(255 => 'Unknown error');
Creates a new Protocol::XMLRPC::MethodResponse instance with a fault.
parse
my $method_response = Protocol::XMLRPC::MethodResponse->parse('<?xml ...');
Creates a new Protocol::XMLRPC::MethodResponse from xml.
$method_response->param(1); $method_response->param(Protocol::XMLRPC::Value::String->new('foo')); my $param = $method_response->param;
Set/get parameter. Tries to guess a type if a Perl5 scalar/arrayref/hashref was passed instead of an object.
fault
$method_response->fault(255 => 'Unknown error'); my $fault = $method_response->fault;
Set/get XML-RPC fault struct.
fault_code
Shortcut for $method_response->fault->members->{faultCode}->value.
fault_string
Shortcut for $method_response->fault->members->{faultString}->value.
to_string
# normal response my $method_response = Protocol::XMLRPC::MethodResponse->new; $method_response->param('baz'); # <?xml version="1.0"?> # <methodResponse> # <params> # <param> # <value><string>baz</string></value> # </param> # </params> # </methodResponse> # fault response my $method_response = Protocol::XMLRPC::MethodResponse->new; $method_response->fault(255 => 'Unknown method'); # or my $method_response = Protocol::XMLRPC::MethodResponse->new_fault(255 => 'Unknown method'); # <?xml version="1.0"?> # <methodResponse> # <fault> # <value> # <struct> # <member> # <name>faultCode</name> # <value><int>255</int></value> # </member> # <member> # <name>faultString</name> # <value><string>Unknown method</string></value> # </member> # </struct> # </value> # </fault> # </methodResponse>
Protocol::XMLRPC::MethodResponse string representation.
To install Protocol::XMLRPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::XMLRPC
CPAN shell
perl -MCPAN -e shell install Protocol::XMLRPC
For more information on module installation, please visit the detailed CPAN module installation guide.