[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Tue Jun 10 23:58:26 UTC 2003


mwilkinson
Tue Jun 10 19:58:26 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv2045/MOBY

Modified Files:
	Central.pm 
Log Message:
WrrrrrrrrRRRRRRRR  the retrieval of WSDL (illegitimate as it may be) suddenly kicks back into life.  Fixed documentation of MOBY::Client::Central to fix the pod2html output.

moby-live/Perl/MOBY Central.pm,1.75,1.76
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/06/10 22:42:44	1.75
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2003/06/10 23:58:25	1.76
@@ -1935,7 +1935,7 @@
 
 sub retrieveService { 
 	my ($pkg,  $payload) = @_;
-	return "<Services>NOT YET IMPLEMENTED</Services>";
+	#return "<Services>NOT YET IMPLEMENTED</Services>";
 	my ($AuthURI, $serviceName) = &_retrieveServicePayload($payload);
 	unless ($AuthURI && $serviceName){return "<Services/>"}
 	my $SI = MOBY::service_instance->new(authority_uri => $AuthURI, servicename => $serviceName);
@@ -1959,13 +1959,16 @@
 	my ($payload) = @_;
 	my $Parser = new XML::DOM::Parser;
 	my $doc = $Parser->parse($payload);
-	my $node = $doc->getDocumentElement();
-	my $obj = $node->getTagName;
-	return undef unless ($obj eq 'retrieveService');
-	my $authURI= $node->getAttributeNode("authURI");  # may or may not have a name
-	if ($authURI){$authURI = $authURI->getValue()}
-	my $serviceName = $node->getAttributeNode("serviceName");  # may or may not have a name
-	if ($serviceName){$serviceName = $serviceName->getValue()}
+	my $x = $doc->getElementsByTagName("Service");
+    my $authURI = "";
+	my $serviceName = "";
+	my $l = $x->getLength;  # might be a Collection object with multiple simples...
+	for (my $n=0; $n < $l; ++$n){
+		$authURI= $x->item($n)->getAttributeNode("authURI");  # may or may not have a name
+		if ($authURI){$authURI = $authURI->getValue()}
+		$serviceName = $x->item($n)->getAttributeNode("serviceName");  # may or may not have a name
+		if ($serviceName){$serviceName = $serviceName->getValue()}
+	}
 	return ($authURI, $serviceName);	
 }
 
@@ -2771,7 +2774,8 @@
 		$sth_simple_in->execute($_);
 		while (my ($objURI, $nsURI, $article) = $sth_simple_in->fetchrow_array()){
 			my $objName = $OSobj->getObjectCommonName($objURI);
-			my @nsURIs = split ",", $nsURI;			
+			my @nsURIs = split ",", $nsURI;
+			$article ||="";
 			$output .="\t\t<Simple articleName='$article'>\n";
 			$output .="\t\t\t<objectType>$objName</objectType>\n";
 			foreach my $ns(@nsURIs){
@@ -2786,7 +2790,8 @@
 			$sth_collection_in->execute($collid);
 			while (my ($objURI, $nsURI, $article) = $sth_collection_in->fetchrow_array()){
 				my $objName = $OSobj->getObjectCommonName($objURI);
-				my @nsURIs = split ",", $nsURI;			
+				my @nsURIs = split ",", $nsURI;
+				$article ||="";
 				$output .="\t\t\t<Simple articleName='$article'>\n";
 				$output .="\t\t\t\t<objectType>$objName</objectType>\n";
 				foreach my $ns(@nsURIs){
@@ -2804,7 +2809,8 @@
 		$sth_simple_out->execute($_);
 		while (my ($objURI, $nsURI, $article) = $sth_simple_out->fetchrow_array()){
 			my $objName = $OSobj->getObjectCommonName($objURI);
-			my @nsURIs = split ",", $nsURI;			
+			my @nsURIs = split ",", $nsURI;
+			$article ||="";
 			$output .="\t\t<Simple articleName='$article'>\n";
 			$output .="\t\t\t<objectType>$objName</objectType>\n";
 			foreach my $ns(@nsURIs){




More information about the MOBY-guts mailing list