[MOBY-l] GetPubmed service: calling from Perl, sample response
Frank Gibbons
fgibbons at hms.harvard.edu
Thu Apr 1 17:38:12 UTC 2004
Oops - sorry about that, Vijay, I was sure I had attached it. The list
server told me my message looked suspicious, and perhaps it stripped it.
Whatever the reason, here it is appended, the output is attached, since
it's rather long.
-Frank
At 12:15 PM 4/1/2004, Vijay Narayanasamy wrote:
>Frank,
>
>The attachment PMid.pl is missing.
>
>Vijay
>
>Vijay Narayanasamy
>Project Programmer / Analyst
>Bioinformatics Program, Human and Molecular Genetics Center
>Medical College of Wisconsin
>8701, W. Watertown Plank Road
>Milwaukee, WI 53226
>414-456-8026
>vnarayan at mcw.edu
>http://brc.mcw.edu/
>
>-----Original Message-----
>From: Frank Gibbons [mailto:fgibbons at hms.harvard.edu]
>Sent: Thursday, April 01, 2004 9:59 AM
>To: moby-l at biomoby.org
>Subject: Re: [MOBY-l] help needed for GetPubmed service
>
>Martin,
>
> Thanks for any advise, actually, if someone can get me any simple XML
> >object and tell me where to send it in order to get an answer and not an
> >errror I will be happy... :-)
>
>
>I'm attaching some Perl code (PMid.pl) that calls the GetPubmed service at
>prometheus. I wrote it last week, and just tried it right now, and it still
>works. I'm also appending the output from the service also (PM.txt).
>
>I hope this helps.
>
>-Frank
>
>
>
>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
================= Perl code to look up PubMed IDs at GetPubmed service
===============
#!/home/fgibbons/bin/perl
use MOBY::Client::Central;
use MOBY::Client::Service;
my $Central = MOBY::Client::Central->new();
my ($Services, $REG) =
$Central->findService( authURI => 'prometheus.brc.mcw.edu',
serviceName => 'GetPubmed'
);
unless ($Services) {
print "Service discovery failed with the following errror: ",
$REG->message;
end
}
my @PMids = ("9788350", "14730315", "12368250");
printf("%-35s\t\t %s\n%s\n", "Service", "provided by", "="x80);
foreach my $S ( @{$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);
foreach my $pmid (@PMids) {
my $result =
$service->execute( XMLinputlist => [
['object0',
"<Object
namespace='PMID' id='" . $pmid
. "' articleName='" .
$pmid . "'/>"],
]
) || 'None';
print "Result: ", $result, "\n";
}
}
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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PM.txt
URL: <http://lists.open-bio.org/pipermail/moby-l/attachments/20040401/a70fbefa/attachment.txt>
More information about the moby-l
mailing list