#!perl -w # Enable Perl warnings use strict; use warnings; use Data::Dumper; # Here I put fixed values, you can of course take them as parameters.... # SOAP::Lite module (tested with version 0.60) use SOAP::Lite; #SOAP::Lite->import(+trace => qw(debug)); # cabri.getBacteriaById WSDL URL # Look on line for all WSDL URLs. my $WSDL = 'http://bioinformatics.istge.it:8080/axis/services/cabri.getBacteriaById?wsdl'; # Create the service interface my $soap = new SOAP::Lite ->service($WSDL) ->proxy('http://bioinformatics.istge.it:8080/', timeout => 600, # Client HTTP connection timeout proxy => ['http' => 'http://bioinformatics.istge.it:8080/axis/services/'], # HTTP proxy config ) ->on_fault( # Map SOAP faults to Perl exceptions (i.e. die). sub { my $soap = shift; my $res = shift; if ( ref($res) eq '' ) { die($res); } else { die( $res->faultstring ); } return new SOAP::SOM; } ); # Build the parameters structure # Input parameters must be defined in a named array. # Keys must be named as the inputs of the service. # Values are effective query terms. # Here, I request the entry having id "DSM 9849" from the DSMZ_BACT library, # remmeber you have to change all blank space occurrences with the '_SP_' string. my %params=(); $params{'libs'} = "DSMZ_BACT"; $params{'id'} = "DSM_SP_9849"; # Create SOAP objects from the input data and parameters data structures my $paramsData = SOAP::Data->name('params')->type(map=>\%params); # Call the runAndWaitFor method on the service using the proxy my $output = $soap->runAndWaitFor($paramsData); # The output is a hash, where keys are the names of the outputs # and values are their actual values. (output keys may vary) # In this case the value of the 'result' key. print $output->{result};