Catalys...::XMLRPC(3)

πŸ“¦
version 0.04 Β· 2 versions
, in fedora 43

πŸ’– 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::Client
  • RPC::XML
  • Catalyst::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 is perl v5.42.0, dated 2025-07-25, and it lives in the Catalys...::XMLRPC(3) manpage slot under User Contributed Perl Documentation. slay, bye bestie! πŸ’–βœ¨πŸ¦‹πŸŒΈπŸ’…
πŸ“¦ where this page comes from