X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FEBIFetchClient.java;h=893608479348c6b88fd99fa9ca6ac6a089ab0b23;hb=5487f5075a649e1e638d10159825c5ca292fa822;hp=5b21bfe092515f97283c01493969dcf18073d963;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/jalview/io/EBIFetchClient.java b/src/jalview/io/EBIFetchClient.java index 5b21bfe..8936084 100755 --- a/src/jalview/io/EBIFetchClient.java +++ b/src/jalview/io/EBIFetchClient.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,158 +18,179 @@ */ package jalview.io; -import org.apache.axis.AxisFault; -import org.apache.axis.client.*; -import org.apache.axis.encoding.XMLType; -import org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory; -import org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory; - import java.io.*; -import javax.activation.DataHandler; +import org.apache.axis.client.*; +import org.apache.axis.encoding.XMLType; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; -public class EBIFetchClient { +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class EBIFetchClient +{ Call call; String format = "default"; String style = "raw"; - public EBIFetchClient() { - try { + /** + * Creates a new EBIFetchClient object. + */ + public EBIFetchClient() + { + try + { call = (Call) new Service().createCall(); call.setTargetEndpointAddress(new java.net.URL( "http://www.ebi.ac.uk/ws/services/Dbfetch")); - } catch (Exception ex) { + } + catch (Exception ex) + { } } - public String[] getSupportedDBs() { - try { + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String[] getSupportedDBs() + { + try + { call.setOperationName(new QName("urn:Dbfetch", "getSupportedDBs")); call.setReturnType(XMLType.SOAP_ARRAY); return (String[]) call.invoke(new Object[] { }); - } catch (Exception ex) { + } + catch (Exception ex) + { return null; } } - public String[] getSupportedFormats() { - try { + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String[] getSupportedFormats() + { + try + { call.setOperationName(new QName("urn:Dbfetch", "getSupportedFormats")); call.setReturnType(XMLType.SOAP_ARRAY); return (String[]) call.invoke(new Object[] { }); - } catch (Exception ex) { + } + catch (Exception ex) + { return null; } } - public String[] getSupportedStyles() { - try { + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public String[] getSupportedStyles() + { + try + { call.setOperationName(new QName("urn:Dbfetch", "getSupportedStyles")); call.setReturnType(XMLType.SOAP_ARRAY); return (String[]) call.invoke(new Object[] { }); - } catch (Exception ex) { + } + catch (Exception ex) + { return null; } } - public String[] fetchData(String ids, String f, String s) { + public static void main (String [] args) + { + EBIFetchClient ebi = new EBIFetchClient(); + String[] result = ebi.fetchData("uniprot:25KD_SARPE;G6PD_HUMAN", + "xml", null); + + try{ + java.io.PrintWriter out = new java.io.PrintWriter( + new java.io.FileWriter("out.xml")); + + + for(int i=0; i