|
|
|||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||
|
KnotInFrame - WebService
This is a short introduction of the KnotinFrame WebServices
offered by the BiBiServ. If you're not familiar with
webservices in general you should have a closer look at our
webservice related linklist.
WSDL - methods, parameters and datatypes
If you have a closer look at the WSDL file describing the
KnotInFrame webservice, you can see two methods belonging
together.
request_orig
response_orig Example Perl client
The example perl client implementation for all methods is based
on SOAP::Lite.
Request_orig:
#!/usr/bin/env perl
use SOAP::Lite;
my $wsdlurl = "http://bibiserv.techfak.uni-bielefeld.de/wsdl/knotinframe.wsdl";
if(!defined $ARGV[1]) {
print "usage: request_orig.pl fastafile\n";
exit 1;
}
my $sequences = "";
open(FILE, $ARGV[1]);
while (FILE){
$sequences .= $_;
}
close FILE;
print "Submitting your request ...\n";
my @params = ("n", SOAP::Data->type(int => $ARGV[0]));
my $result = SOAP::Lite->service($wsdlurl)
->on_fault(sub {soapFaultHandler(@_)})
->request_orig($sequences,\@params);
print "got id: '$result'\n";
sub soapFaultHandler {
my($soap, $res) = @_;
if (ref $res) {
my $detail = $res->faultdetail;
if(defined($detail->{"hobitStatuscode"})) {
print $detail->{"hobitStatuscode"}->{"description"};
print "(".$detail->{"hobitStatuscode"}->{"statuscode"}.")\n";
} else {
print "Servlet Error - no Hobit Statuscode\n";
}
} else {
print "HTTP Layer Error: ";
print $soap->transport->status."\n";
}
exit 1;
}
Response_orig:
#!/usr/bin/env perl
use SOAP::Lite;
my $wsdlurl = "http://bibiserv.techfak.uni-bielefeld.de/wsdl/knotinframe.wsdl";
if(!defined $ARGV[0]) {
print "usage: response_orig.pl bibiid\n";
exit 1;
}
print "Submitting your id...\n";
my $result = SOAP::Lite->service($wsdlurl)
->on_fault(sub {soapFaultHandler(@_)})
->response_orig($ARGV[0]);
print $result;
sub soapFaultHandler {
my($soap, $res) = @_;
if (ref $res) {
my $detail = $res->faultdetail;
if(defined($detail->{"hobitStatuscode"})) {
print $detail->{"hobitStatuscode"}->{"description"};
print "(".$detail->{"hobitStatuscode"}->{"statuscode"}.")\n";
} else {
print "Sevlet Error - no Hobit Statuscode\n";
}
} else {
print "HTTP layer Error: ";
print $soap->transport->status."\n";
}
exit 1;
}
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||