[MOBY-l] website revamped
Martin Senger
senger at ebi.ac.uk
Thu Nov 27 00:33:57 UTC 2003
> If I have missed referencing anyone's stuff (sorry!) please send me the
> info, URL, or whatever, and I'll be sure to put it up right away!
>
Page "Connecting to MOBY-Central" could have also an example in Java.
Here it is:
--- begin ---
import org.biomoby.shared.*;
import org.biomoby.client.*;
import java.util.*;
public class RetrieveServiceTypes {
public static void main (String [] args) {
try {
Central worker = new CentralImpl (CentralImpl.DEFAULT_ENDPOINT,
CentralImpl.DEFAULT_NAMESPACE);
System.out.println ("KNOWN SERVICE TYPES\n");
Map types = worker.getServiceTypes();
for (Iterator it = types.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry)it.next();
System.out.println (entry.getKey());
System.out.println ("\t" + entry.getValue());
}
} catch (Exception e) {
System.err.println ("===ERROR===");
System.err.println (e.toString());
System.err.println ("===========");
}
}
}
--- end ---
Also the Perl example is not complete (and should be). It needs:
a) to add use MOBY::Client::Central;
b) to add semicolon at the end, and
c) print better the result (now it prints just:
KNOWN SERVICE TYPES
HASH(0x867aed8)
Cheers,
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-l
mailing list