[MOBY-dev] bug(s) in method DUMP

Martin Senger senger at ebi.ac.uk
Thu Oct 9 02:05:12 EDT 2003


Mark,
   I have found several weaknesses in the DUMP method:

1) [Important] The DUMP method is the only MOBY Central method that does
not return a string - it returns an array of strings. SOAP::Lite client is
more forgiving than the Java client. Therefore, you have not noticed that
method DUMP returns a wrong XNML contents. It returns this (the texts
where should be the contents of the individual databases was changed by me
to simple words 'mobecentral', 'mobyobject' etc. to make it easier to read
it):

<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope ... >
      <SOAP-ENV:Body>
         <namesp1:DUMPResponse xmlns:namesp1="http://mobycentral.cbr.nrc.ca/MOBY/Central">
            <s-gensym3 xsi:type="xsd:string">mobycentral</s-gensym3>
            <s-gensym5 xsi:type="xsd:string">mobyobject</s-gensym5>
            <s-gensym7 xsi:type="xsd:string">mobyservice</s-gensym7>
            <s-gensym9 xsi:type="xsd:string">mobynamespace</s-gensym9>
            <s-gensym11 xsi:type="xsd:string">mobyrelationship</s-gensym11>
         </namesp1:DUMPResponse>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

You can see that the five returned strings is not labelled as an array.
The Java Axis libraries interprets it as ONE string - so using the Java
cmd line client
   (e.g. ./run-cmdline-client -call DUMP)
it return the contents only of the mobycentral database, the rest is
ignored.

   My understanding of SOAP is that the correct XML should be like this:

<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope ... >
         <namesp1:DUMPResponse xmlns:namesp1="http://mobycentral.cbr.nrc.ca/MOBY/Central">
            <SOAP-ENC:Array xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[5]">
               <item xsi:type="xsd:string">mobycentral</item>
               <item xsi:type="xsd:string">mobyobject</item>
               <item xsi:type="xsd:string">mobyservice</item>
               <item xsi:type="xsd:string">mobynamespace</item>
               <item xsi:type="xsd:string">mobyrelationship</item>
            </SOAP-ENC:Array>
         </namesp1:DUMPResponse>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

   You can achieve it in MOBY::Central.pm in method DUMP by returning the
reference to the resulting array instead of returning just an array. You
may consider to change the line:

   return ($mobycentral, $mobyobject, $mobyservice, $mobynamespace, $mobyrelationship);

to line

   return [($mobycentral, $mobyobject, $mobyservice, $mobynamespace, $mobyrelationship)];

   (I have not found why 'return \(...)' does not work. But it does not.)

   I am not changing it myself because you have to check your perl clients
how they work after such change on the server side. But the change is
important for us, Java users.

2) [Less important] The dump is done by calling an external program
mysqldump. Unfortunately, the path to the script is hard-coded. That
should not be. In documentation from Singapore, there is still a remark
about a file called central.cfg. If such file is used, this can be put
there (in order to reflect local installation). But I am not sure if you
still using such file.
   This external program also needs to get password. I do not know how to
change the command line to do so. I have tried to change your line:

open (IN, "/usr/local/bin/mysqldump -u mobycentral mobycentral |") || ...

to something like:

open (IN, "/usr/local/bin/mysqldump -u mobycentral --password='mypassword' mobycentral |") || ...

which works fine from the command-line but it hangs if I use it in
Central.pm (probably it waits for an input). I do not know hot to change
this. Are you using password(s) for your MOBY Central at all? Any idea
what to do to get a dump from my local moby?

3) [Annoying] The dump should have included lines 'use <database-name>'
before dumping tables for that database. Otherwise it creates all tables
into one databases.

4) [Future] As I mentioned during the Vancouver meeting, the DUMP method
is the only one that depends on the underlying implementation. It would
return completely different results if the central will be implemented by
LDAP or perhaps even by other RDMS. Therefore, it woulod be nicve to have
it either renamed to DUMP_MYSQL, or allow it an input parameter specifying
what format I expect (default may be mysql, of course).

   Regards,
   Martin

-- 
Martin Senger

EMBL Outstation - Hinxton                Senger at EBI.ac.uk     
European Bioinformatics Institute        Phone: (+44) 1223 494636      
Wellcome Trust Genome Campus             (Switchboard:     494444)
Hinxton                                  Fax  : (+44) 1223 494468
Cambridge CB10 1SD
United Kingdom                           http://industry.ebi.ac.uk/~senger






More information about the MOBY-dev mailing list