Perl Commandline

From Rackspace Email & Apps API
Jump to: navigation, search

To use this tool, you'll need a recent version of Perl (5.8.0 or better), and two Perl modules:

 SOAP::Lite
 Data::Dumper

To install the modules from a *nix commandline, try the following:

 perl -MCPAN -e shell
 install SOAP::Lite (say "yes" to any questions about dependencies)
 install Data::Dumper (again, "yes" to dependencies)

To use the tool, make a new file on your system with the contents of the code below, save it as executable (Mac & *nix only). Remember that Perl expects placeholder variables to be passed in as well. So if you had named your copy of the script "liteinterface.pl", you would call the AddUser() function like this from a commandline:

 $ ./liteinterface.pl liteinterface.pl https://admin.webmail.us/excedentsoap/excedentsoap.wsdl \
     AddUser myadmin mypass somedomain.com kaverett 1 "" "" "" "" "" "" "" "" "" ""
#!/usr/bin/perl -w
use strict;
use SOAP::Lite;
use Data::Dumper;
my $wsdl = shift(@ARGV);
my $func = shift(@ARGV);
print Dumper(SOAP::Lite->service($wsdl)->$func(@ARGV));