[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Tue Mar 11 14:44:19 UTC 2008


kawas
Tue Mar 11 10:44:18 EDT 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi
In directory dev.open-bio.org:/tmp/cvs-serv19260/Perl/MOBY-Server/share/cgi

Modified Files:
	authority.pl 
Log Message:
added code that returns wsdl documents (declared via import statements) requested whenever you try to use parse the wsdl obtained from the lsid server.
the code loops through the INC paths looking for files. if they are found, they are printed out to stdout. otherwise, the default behaviour is done.
moby-live/Perl/MOBY-Server/share/cgi authority.pl,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/authority.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/authority.pl	2008/02/21 00:21:27	1.1
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/authority.pl	2008/03/11 14:44:18	1.2
@@ -37,6 +37,25 @@
 
 ##############
 
+# serve wsdl documents on request if they exist and are readable ...
+# obtain them from the INC
+if($ENV{'REQUEST_URI'} && ($ENV{'REQUEST_URI'} =~ /^\/authority\/(\w+)\.wsdl/)) {
+  my $wsdl_location = undef;
+  for my $dir (@INC) {
+    my $ls_module = "LS/Authority/WSDL/$1.wsdl";
+    $wsdl_location = "$dir/$ls_module" if -e "$dir/$ls_module";
+  }
+  if ($wsdl_location and -e $wsdl_location and -r $wsdl_location) {
+    my $parser = XML::LibXML->new();
+    my $doc = undef;
+    eval {
+      $doc    = $parser->parse_file( "$wsdl_location" );
+      my $doc = $doc->toString();
+      print "Content-type: text/xml\n\n$doc" if $doc;
+    }
+  }
+}
+
 my $location = 'http://';
 
 # TODO get this from the mobyconfig file




More information about the MOBY-guts mailing list