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

passta - WebService

This is a short introduction using passta 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 passta 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 passta WebService we use a technique called Request and Reply with polling based on BiBiWS. First the client side (e.g. your program) requests a passta 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 passta 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 - a (single) sequence file in FASTA format 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)
mode Integer Set Passta working mode (see manual for more details) (optional)
profile Boolean Compute secondary structure profile (optional)
jumpcost String Specify jumpcost for Pass Two annotation (optional)
Format: StartValue.StopValue.StepWidth, e.g. 36.43.6
recost String Specify rearrangement cost for Pass Two annotation (optional)
Format: StartValue.StopValue.StepWidth, e.g. 34.37.2

response_orig
The response_orig method gets the id returned by the request method as input parameter and returns the calculated result in html format.

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/passta.wsdl";
#test system
#$wsdlurl = "http://bibitest.techfak.uni-bielefeld.de/wsdl/passta.wsdl";

my $mode; #working mode
my $profile; #secondary structure profile
my $jc; #jump cost
my $rc; #rearrangement cost
my $inputfile = "";
my $email="";

GetOptions("mode:i" => \$mode,                #integer
           "profile" => \$profile,      #boolean
           "jumpcost:s" => \$jc,          #string
           "recost:s" => \$rc,            #string
           "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 (defined($mode)) {
    @params = (@params, "mode", SOAP::Data->type(int => $mode));
} 
if(defined($profile)){
    @params = (@params, "profile", SOAP::Data->type(boolean => 1));
} else {
    @params = (@params, "profile", SOAP::Data->type(boolean => 0));
}
if (defined($jc)) {
    @params = (@params, "jumpcost", SOAP::Data->type(string => $jc));
}
if (defined($rc)) {
    @params = (@params, "recost", SOAP::Data->type(string => $rc));
}
if(defined($email) && $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/passta.wsdl";
#test system
#$wsdlurl = "http://bibitest.techfak.uni-bielefeld.de/wsdl/passta.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 $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
Manual
Contact
Fri Dec 14 12:59:42 2012