[MOBY-l] Interpreting results from Service->execute()
Frank Gibbons
fgibbons at hms.harvard.edu
Tue Mar 16 23:07:28 UTC 2004
Hi MOBYers,
I've been playing with MOBY all day (installed Perl 5.8.3 just for this!),
and find that it works pretty well. I've successfully called
plantspGetProtein from sdsc.edu and GetPubmed from prometheus.brc.mcw.edu.
Now I'm trying to call getInteractingMethods from pdg.cnb.uam.es, and
although it returns something, I just don't understand what it returns. The
code I'm using to call it is appended at the end of this (having been
cribbed from
Catherine Letondal and Ken Streube - thanks to both for great tutorials!),
but the important part is this:
my $pid = "EBI-141";
my $result =
$service->execute( XMLinputlist => [
["object$i",
"<Object namespace='IntAct'
id='$pid'/>"]
] ) || 'None';
Response is:
<?xml version='1.0' encoding='UTF-8'?>
<moby:MOBY xmlns:moby='http://www.biomoby.org/moby'
xmlns='http://www.biomoby.org/moby'>
<moby:Response moby:authority='pdg.cnb.uam.es'>
<moby:queryResponse queryID='1'/>
</moby:Response>
</moby:MOBY>
Now I'm not XML expert, but it's certainly not gibberish, or an error
condition. I'm fairly sure the accession number I'm using is correct (it
works when I go to IntAct's webpage): if it's not correct, shouldn't the
service let me know somehow ("ID not found"). And if it is correct, where's
my information? If the id is correct, but there are in fact no interacting
methods, shouldn't it say "There are no interacting methods"? Instead it
seems to just be acknowledging my request, but not providing any new
information.
I'll be the first to admit ignorance of XML, SOAP, etc. If this is a really
dumb question, I'll be happy to read whatever you guys suggest. But I'm
really hoping there's a simpler answer
Thanks (in advance),
-Frank Gibbons
========================= appended code here =========================
#!/home/fgibbons/bin/perl
use MOBY::Client::Central;
use MOBY::Client::Service;
use strict;
my $Central = MOBY::Client::Central->new();
my ($Services, $REG) =
# );
# $Central->findService( authURI => 'prometheus.brc.mcw.edu',
# serviceName => 'GetPubmed'
$Central->findService( authURI => 'pdg.cnb.uam.es',
serviceName => 'getInteractingMethods'
);
unless ($Services) {
print "Service discovery failed with the following errror: ",
$REG->message;
exit(0);
}
my @PIDs = ('1BIJ', '4HHB');
my @IntActIDs = ('EBI-141');
printf("%-35s\t\t %s\n%s\n", "Service", "provided by", "="x80);
foreach my $S ( #sort {
#$a->authority cmp $b->authority or
#$a->name cmp $b->name }
@{$Services}) {
printf("%-35s\t\t%s%s\n", $S->name, $S->authority, $S->description);
my $WSDL = $Central->retrieveService($S);
my $service = MOBY::Client::Service->new(service => $WSDL);
my $i = 0;
foreach my $pid (@IntActIDs) {
my $result =
$service->execute( XMLinputlist => [
["object$i",
"<Object namespace='IntAct'
id='$pid'/>"]
] ) || 'None';
print "Result ($i): $result\n";
$i++;
}
}
PhD, Computational Biologist,
Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA.
Tel: 617-432-3555 Fax:
617-432-3557 http://llama.med.harvard.edu/~fgibbons
More information about the moby-l
mailing list