Building a simple WSDL client in perl
#!/usr/bin/perl
use strict;
use warnings;
use XML::Compile::WSDL11;
use XML::Compile::Transport::SOAPHTTP;
use Data::Dumper;
# get the WDSL description frome somewhere www, file or the script
# we get it lazy from the web but propabily a file is a better place
use LWP::Simple;
my $xml_desc = get('http://www.maxmind.com/app/minfraud_soap_wsdl6');
# compile it once
my $wsdl = XML::Compile::WSDL11->new($xml_desc);
my $minfraud_soap = $wsdl->compileClient(
'minfraud_soap',
port => 'minfraudWebServiceSoap',
service => '{http://www.maxmind.com/maxmind_soap/minfraud_soap}minfraudWebService',
);
#
# and now reuse the object as often as you like! with your parameter
#
my ( $res, $trace ) =
$minfraud_soap->(
i => '24.24.24.24',
country => 'US',
license_key => 'xxxx',
);
print Dumper($res);