[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at dev.open-bio.org
Mon Jan 13 20:10:25 UTC 2003


Mon Jan 13 15:10:25 EST 2003
Update of /home/repository/moby/moby-live/Perl/Client
In directory dev:/tmp/cvs-serv9785

Modified Files:
	simple_client.pl 
Log Message:
OOPS... simple_client has not been working for quite a while.  It now works out of the box using services that run from Flybase instead of from my local - dead - machine.
moby-live/Perl/Client simple_client.pl,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/Client/simple_client.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /tmp/T0uHa4it	2003-01-13 15:10:25.240006510 -0500
+++ /tmp/T1vHa4it	2003-01-13 15:10:25.240006510 -0500
@@ -3,30 +3,33 @@
 use MOBY::Client::Central;
 use MOBY::Client::Service;
 
-#my $Central = MOBY::Client::Central->new(MOBY_server => "http://192.168.1.9/cgi-bin/MOBY-Central.pl");
-my $Central = MOBY::Client::Central->new(MOBY_server => "http://bioinfo.pbi.nrc.ca:8099/cgi-bin/MOBY-Central.pl");
+my $Central = MOBY::Client::Central->new(MOBY_server => "http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl");
 
-print "looking for services that use Objects with genbank ID's to retrieve\n";
-my %services =  $Central->locateServiceByInput(['Object'], ['GenBank/GI'], 'Retrieve');
+print "looking for services that use Generic Keywords for retrieval\n";
 
-my ($ServiceName, $TYPE) = each %services;
-my ($URI, $name) = (($ServiceName =~ /(.+?)#(.+)/) && ($1, $2));
-my ($type, $desc) = (($TYPE =~ /(.+?)\;(.+)/) && ($1, $2));
-					 
-print "\nFound:\n".
-	"\tFrom: $URI\n".
-	"\tName: $name\n".
-	"\tType: $type\n".
-	"\tDesc: $desc\n\n";
-my @wsdl = $Central->retrieveServiceByName([$ServiceName]);
-					 
-# the next line is ONLY for Mark's installation
-# because it runs off  of my local machine
-# $servicedef =~ s/bioinfo\.pbi\.nrc\.ca\:8099/192.168.1.9/g;
+# returns a list of ServiceInstance objects
+my @services =  $Central->locateServiceByInput(['Object'], ['Generic/Keyword'], 'Retrieve');
 
-my $Service = MOBY::Client::Service->new(service => $wsdl[0]);
-print "Executing Service: ",$Service->ServiceName," with Genbank GI=168257\n"; 
+foreach (@services) {
+	print "\nFound:\n",
+	"\tFrom: ",$_->authority,"\n",
+	"\tName: ",$_->name,"\n",
+	"\tType: ",$_->type,"\n",
+	"\tOutput: ",$_->output,"\n",
+	"\tDesc: ",$_->description,"\n\n";
+
+	my $wsdl = $Central->retrieveService($_->authority, $_->name);
+	my $Service = MOBY::Client::Service->new(service => $wsdl);
+	print "Executing Service: ",$Service->ServiceName," with keywords '*brassinosteroid*' and '*apoptosis*'\n"; 
+
+	my $request = "
+	<MOBY>
+		<Object namespace='Generic/Keyword' id='*brassinosteroid*'/>
+		<Object namespace='Generic/Keyword' id='*apoptosis*'/>
+	</MOBY>";
+
+	my $data = SOAP::Data->type(base64 => $request);
+	eval {print $Service->execute($data)};
+	if ($@){print "Service Unavailable\n\n\n\n\n"};
+}
 
-my $data = SOAP::Data->type(base64 => "<Object namespace='GenBank/GI' id='168257'/><Object namespace='GenBank/GI' id='168257'/>");
-
-print $Service->execute($data);




More information about the MOBY-guts mailing list