use SOAP::Lite;
# Initialize WebService
$ep = "http://bch.biodiv.org/service/3.0/service.asmx"; # endpoint
$ns = "http://bch.biodiv.org/service/3.0"; # namespace
$sa = "getThesaurus"; # action
$webService = SOAP::Lite
-> uri($ns)
-> on_action( sub { join "/", $ns, $_[1] } ) # ASP.NET WebService compatibility
-> proxy($ep);
$method = SOAP::Data->name($sa)->attr( { xmlns => $ns } );
@params = (SOAP::Data->name(domainID => 1));
# Call SOAP Method
$result = $webService->call($method, @params);
unless ($result->fault)
{
print "DomainXml: ", $result->result();
}
else
{
# Output error message to console
print $result->faultcode, " - ", $result->faultstring;
}