Skip to content

Instantly share code, notes, and snippets.

@gmillerd
Last active January 31, 2017 19:42
Show Gist options
  • Select an option

  • Save gmillerd/b50d26c46eb75a3bf40f3c43efc2d4b2 to your computer and use it in GitHub Desktop.

Select an option

Save gmillerd/b50d26c46eb75a3bf40f3c43efc2d4b2 to your computer and use it in GitHub Desktop.
simple mangos soap client, using perl and soap::lite
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite; # visit http://search.cpan.org/dist/SOAP-Lite/ or apt-get install libsoap-lite-perl
my ($user, $pass) = ('gm', 'secret');
my $host = 'http://127.0.0.1:7878/';
my $cmd = $ARGV[0];
BEGIN {
sub SOAP::Transport::HTTP::Client::get_basic_credentials {
return $user => $pass,
}
}
my $soap = SOAP::Lite
->proxy($host)
# ->uri('urn:TC'); # trinitycore namespace
->uri('urn:MaNGOS');
my $rc = $soap->call('executeCommand',
SOAP::Data->name('command')->value($cmd));
die $rc->faultstring if ($rc->fault);
print
$rc->result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment