Catalyst::Model::XMLRPC - XMLRPC model class for Catalyst
# Model __PACKAGE__->config( location => 'http://webservice.example.com:9000', ); # Controller sub default : Private { my ($self, $c) = @_; my $res; eval { $res = $c->model('RemoteService')->send_request('system.listMethods'); $c->stash->{value} = $res->value; }; if ($@) { # Something went wrong... } ... };
This model class uses RPC::XML::Client to invoke remote procedure calls using XML-RPC.
You can pass the same configuration fields as when you call RPC::XML::Client, the only special thing is that the URI is provided via the location field.
Take a look at RPC::XML::Client to see the method you can call.
Called from Catalyst.
By default, there is an error_handler and a fault_handler provided for the RPC::XML::Client object that call Carp::croak. You can override it if you want via the config call.
You'll get this error, if you haven't provided a location. See Config.
Something went wrong while trying to create an RPC::XML::Client object. See documentation of this module for further references.
RPC::XML::Client
RPC::XML
Catalyst::Model
Daniel Westermann-Clark's module, Catalyst::Model::LDAP, it was my reference.
Lee Aylward, for reporting the issue regarding v.0.03.
Florian Merges, <fmerges@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Model::XMLRPC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Model::XMLRPC
CPAN shell
perl -MCPAN -e shell install Catalyst::Model::XMLRPC
For more information on module installation, please visit the detailed CPAN module installation guide.