[MOBY-l] glue for web services...
Michael Jensen
michael at acutrans.net
Fri Nov 21 05:02:04 UTC 2003
There are lots of neat services people are putting up on moby. One of
the advantages to moby is being able to put together services...one
service's output as another's input. Is there some quick way to get the
output from one service into another service without parsing all the
XML as the result? For example I would like to use SearchPubMed and get
some PMIDs, and then use those in GetPubmed to get the MEDLINE display
format. Any help, guidance, or redirection would be appreciated!
I have been learning by using one of the tutorial scripts like the
following:
#!/usr/bin/perl
#Executes a service, where the name of the service, its namespace and
its parameter are provided on the command line.
use MOBY::Client::Central;
use MOBY::Client::Service;
my $Central = MOBY::Client::Central->new();
my $serv_name = ($ARGV[0])? $ARGV[0] : 'getGoTerm';
my $namespace = ($ARGV[1])? $ARGV[1] : 'go';
my $query = ($ARGV[2])? $ARGV[2] : '0012502';
print $serv_name, " ", $namespace, " ", $query, "\n";
my ($ServiceInstances,$RegObject) = $Central->findService(
serviceName=>$serv_name);
if (not $ServiceInstances) {
die $RegObject->message;
}
foreach my $ServiceInstance (@{ $ServiceInstances} ) {
my $WSDL = $Central->retrieveService($ServiceInstance);
my $Service = MOBY::Client::Service->new(service => $WSDL);
my $Triple = '<Object namespace="' . $namespace . '" id="' . $query
. '"/>';
print "Triple: $Triple\n";
print "Sending request to ", $ServiceInstance->authority,"\n";
my $result = $Service->execute(XMLinputlist => [
['object1', $Triple] ]);
print "result: ", $result, "\n";
}
The result is in XML format so I could parse it and get my values, but
I was thinking there may be a better way to do it than I am not aware
of. Thanks!
-Michael Jensen
mdjgf8 at mizzou.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2022 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/moby-l/attachments/20031120/b4569df6/attachment-0003.bin>
More information about the moby-l
mailing list