/* * Jalview - A Sequence Alignment Editor and Viewer * 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 * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package jalview.io; import java.io.*; import java.util.Enumeration; import java.util.Hashtable; import java.util.StringTokenizer; import org.apache.axis.client.*; import org.apache.axis.encoding.XMLType; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; /** * DOCUMENT ME! * * @author $author$ * @version $Revision$ */ public class EBIFetchClient { Call call; String format = "default"; String style = "raw"; /** * 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) { } } /** * 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) { return null; } } /** * 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) { return null; } } /** * 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) { return null; } } 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-1 && (p+3