Better part of an hour wandering lost through the official source for the tool you're using, which barely has any documentation on that actual tool at all, and certainly not on your specific question--versus seven minutes building an example and testing, to find out that's because the behavior you wanted is the default, but no one saw fit to either document that or at least give an example, even when the server version of the client example Well, then.
This:
XMLRPC::Transport::HTTP::CGI
-> dispatch_to ('moose') # 'moose' being a module
-> handle;
package moose;
sub rawr { ... }
means, "If the client asks for moose.rawr, run moose::rawr." Is that so hard to say, at least somewhere?
Comments
comment
My god. I just lost hours wading through the docs and source and still hadn’t decoded this. Thank you so much for posting this where Google could find it.
comment
First, thanks so much for this example. I’m lucky that I found your example within 15 minutes of starting to learn XML-RPC::Lite. I’m sure you saved me hours!!!!
I have a request though. Could you take it a step further? Show a simple example of reading the arguments passed in and sending the response :-)
In the meantime I’ll keep looking
comment
Okay after about 90 minutes of searching and trying things I found out this is how you call something
!/usr/bin/perluse XMLRPC::Lite; use Data::Dumper;
blogger api uses an APP key which is kind of like a Windows GUID. You can make up your own or go to blogger to have one made for you. If the blogger supplied one is used then people can track you down to tell you your script is failing etc.my $appkey = “thiscanbeanything”;
I assumed it worked like this, I WAS WRONG! -> call(‘metaWeblog.getRecentPosts’, { appkey => $appkey, blogid=”1”, username => “myname”, password => “mypasswd”, numberOfPosts => “4” }) instead it works like thismy $data = XMLRPC::Lite -> proxy(‘http://mywebsite.com/mt/mt-xmlrpc.cgi’) -> call(‘blogger.getRecentPosts’, $appkey, “1”, “myname”, “mypass”, 4 ) -> result;
if (defined ($data)) { print Dumper ($data); } else { print “failed: $!”; }