Catalys...::XMLRPC(3)
π Catalyst::Model::XMLRPC π
okay bestie, so this is Catalyst::Model::XMLRPC β a Perl manual page, section 3, straight outta the User Contributed Perl Documentation. It's the XMLRPC model class for Catalyst, and honestly? she's giving "small but mighty". Let's get into it. π¦
β¨ NAME β¨
Catalyst::Model::XMLRPC β the XMLRPC model class for Catalyst. that's it, that's the whole vibe check. π
β¨ SYNOPSIS β¨
okay so here's how you actually use her. First you set up the model, then you hit it from a controller:
# 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...
}
...
};
see how she's doing an eval around the send_request call? that's the move. system.listMethods gets sent, the result lands in $c->stash->{value} via $res->value, and if things go sideways you catch it in the $@ branch. iconic error handling tbh. π«Ά
β¨ DESCRIPTION β¨
so basically this model class uses RPC::XML::Client to invoke remote procedure calls using XML-RPC. that's the whole job. she's a wrapper, she's a connector, she's the bestie that talks to the remote service so you don't have to. π
β¨ CONFIGURATION β¨
you can pass the exact same configuration fields that you'd pass when you call RPC::XML::Client. the only special thing β the one little twist β is that the URI gets provided through the location field. so yeah, location is where your URL goes, and everything else is just RPC::XML::Client business as usual. no cap. π
β¨ METHODS β¨
πΈ General πΈ
go take a peek at RPC::XML::Client to see the methods you can call. she's got them, we're just borrowing them. iykyk. π§
πΈ new πΈ
called from Catalyst. that's her whole origin story. β¨
β¨ NOTES β¨
by default, there's an error_handler and a fault_handler provided for the RPC::XML::Client object, and both of them call Carp::croak. if that's not your vibe, you can override it via the config call. your model, your rules. π
β¨ DIAGNOSTICS β¨
π Must provide an location
you'll get this error if you haven't provided a location. see Config. (yes, the grammar is exactly as written, we're keeping it, no editing bestie π)
π Can't create RPC::XML::Client object
something went wrong while trying to create an RPC::XML::Client object. see the documentation of this module for further references. π
β¨ SEE ALSO β¨
RPC::XML::ClientRPC::XMLCatalyst::Model
go read them, they're the supporting cast and they ate. π₯
β¨ ACKNOWLEDGEMENTS β¨
- Daniel Westermann-Clark's module,
Catalyst::Model::LDAPβ it was my reference. shoutout, fr fr. π - Lee Aylward, for reporting the issue regarding v.0.03. thank you for your service. π«‘
β¨ AUTHOR β¨
Florian Merges, <fmerges@cpan.org> π
β¨ LICENSE β¨
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so go wild, just keep it free. β
π cute little sign-off: this page isperl v5.42.0, dated2025-07-25, and it lives in theCatalys...::XMLRPC(3)manpage slot under User Contributed Perl Documentation. slay, bye bestie! πβ¨π¦πΈπ
π¦ where this page comes from
- fedora 43: perl-Catalyst-Model-XMLRPC 0.04-49.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms