BiBiServ Logo
Attention:
Due to technical maintenance some tools might be unavailable.
See maintenance information.
BiBiServ -
                                    Bielefeld         University Bioinformatic Service
Tools
Education
Administration
Tools
Genome Comparison
Gecko
REPuter
...more
Alignments
PoSSuMsearch2
ChromA
...more
Primer Design
GeneFisher2
RNA Studio
RNAshapes
KnotInFrame
RNAhybrid
...more
Evolutionary Relationship
ROSE
...more
Others
XenDB
jPREdictor
...more

roci - WebService

This is a short introduction using roci WebServices offered by BiBiServ. If you're not familiar with using webservices in general you should have a closer look to our webservice related linklist.

WSDL - methods, parameters and datatypes

If you've a closer look at the WSDL file describing the roci webservice, you can see two methods belonging together.

request_orig and response_orig

Bioinformatic programs often perform computation on large data sets and therefore require much CPU time. This can cause problems like http connection timeouts (usually after 5 minutes) during online usage. To avoid such problems when using roci WebService we use a technique called Request and Reply with polling based on BiBiWS. First the client side (e.g. your program) requests a roci job submitting the necessary data (parameter and data) and gets an id after the job is started. Afterwards the client can request the result by calling the corresponding response method with the id returned earlier. If the roci job is not finished, the user gets a status code with an enhanced description of current status back (see HOBIT status codes for more information).

request_orig
The request_orig method gets two parameters as input - the input data (consisting of two blocks: a phylogenetic tree and its annotation, see manual for further information) and a parameter array with key/value pairs as described in the following table - and returns either a unique id or in case of an error a fault message.

key type description
email String email adress for mail notification (default: empty String) (optional)
a Boolean Extended search space (default: off) (optional)
v Boolean Verbose mode (default: off) (optional)

response_orig
The response_orig method gets the id returned by the request method as input parameter and returns the calculated result as plain text consisting of three parts: the input, the result of the bottom-up phase and the result of the top-down refinement.

Example Perl clients

The example perl client implementation for all methods is based on SOAP::Lite.

Example Client for the requestOrig method (Download Source):



#!/usr/bin/env perl 
use SOAP::Lite;
use Data::Dumper;
use Getopt::Long;
use Encode;
use utf8;

#production system
$wsdlurl = "http://bibiserv.techfak.uni-bielefeld.de/wsdl/roci.wsdl";
#test system
#$wsdlurl = "http://bibitest.techfak.uni-bielefeld.de/wsdl/roci.wsdl";

my $a; #Extended search space
my $v; #verbose mode
my $inputfile = "";
my $email="";

GetOptions("a" => \$a,                        #boolean
           "v" => \$v,                          #boolean
           "inputfile=s" => \$inputfile,  #file
           "email=s" => \$email                  #String
   );

if($inputfile eq ""){
        print "At least inputfile must be given! (-inputfile <filename>)\n";
        exit 1;
}

my $input = readFile($inputfile);
$input = encode('utf8', $input);

my @params;
if($a){
        @params = (@params, "a", SOAP::Data->type(boolean => $a));
}
if($v){
        @params = (@params, "v", SOAP::Data->type(boolean => $v));
}
if($email ne ""){
        @params =(@params, "email", SOAP::Data->type(string => $email));
}

print "Submitting your request ...\n";
$result = SOAP::Lite->service($wsdlurl)
  ->on_fault(sub {soapFaultHandler(@_)})
  ->request_orig(SOAP::Data->type(string=>$input), \@params);

print "got id: '$result'\n";

sub soapFaultHandler {
  print "\n Error:\n";
  my($soap, $res) = @_;
  if (ref $res) {
    print "Statuscode:".$res->faultcode."\n";
    print "Description:".$res->faultstring."\n";
    $detail = $res->faultdetail;
        if(defined($detail->{"hobitStatuscode"})) {
      print Dumper $detail->{"hobitStatuscode"}->{"statuscode"};
      print Dumper $detail->{"hobitStatuscode"}->{"description"};
    } else {
          print "Sevlet Error - no Hobit Statuscode\n";
        }
  } else {
        print "http layer Error: ";
    print $soap->transport->status;
  }
  exit 1;
}

sub readFile{
  my $file = shift;
  my $content = "";
  open(FILE, $file) or die("Cannot open file $file !");
  foreach my $line (<FILE>){
        $content .= $line;
  }
  close FILE;
  return $content;
}
          

Example Client for the responseOrig method (Download Source):


#!/usr/bin/env perl 

use SOAP::Lite;
use Data::Dumper;
#production system
$wsdlurl = "http://bibiserv.techfak.uni-bielefeld.de/wsdl/roci.wsdl";
#test system
#$wsdlurl = "http://bibitest.techfak.uni-bielefeld.de/wsdl/roci.wsdl";

if(!defined $ARGV[0]) {
  print "call with id\n";
  exit 1;
}
print "Submitting your id... ";
$result = SOAP::Lite->service($wsdlurl)
  ->on_fault(sub {soapFaultHandler(@_)})
  ->response_orig($ARGV[0]);
print Dumper $result;

sub soapFaultHandler {
  my($soap, $res) = @_;
  if (ref $res) {
    print "Statuscode:".$res->faultcode."\n";
    print "Description:".$res->faultstring."\n";
    $detail = $res->faultdetail;
    print Dumper $detail->{"hobitStatuscode"}->{"statuscode"};
    print Dumper $detail->{"hobitStatuscode"}->{"description"};
  } else {
        print "http layer Error: ";
    print $soap->transport->status;
  }
  exit 1;
}
Welcome
Submission
WebService
References
Manual
Contact
Fri Dec 14 13:01:12 2012