Search in sources :

Example 1 with ChebiWebServicePortType

use of uk.ac.ebi.www.webservices.chebi.ChebiWebServicePortType in project vcell by virtualcell.

the class DataBaseReferenceReader method getChEBIName.

public static String getChEBIName(String chebiId) {
    String name = null;
    SearchCategory sc = SearchCategory.fromString(SearchCategory._value3);
    int maxResults = 200;
    StarsCategory starts = StarsCategory.value1;
    ChebiWebServiceServiceLocator locator = new ChebiWebServiceServiceLocator();
    ChebiWebServicePortType portType = null;
    try {
        portType = locator.getChebiWebServicePort();
        LiteEntity[] le = portType.getLiteEntity(chebiId, sc, maxResults, starts);
        if (le != null)
            name = le[0].getChebiAsciiName();
    // System.out.println((le!=null)?le[0].getChebiAsciiName():"cannot find" + chebiId);
    } catch (ChebiWebServiceFault e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (ServiceException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return name;
}
Also used : SearchCategory(uk.ac.ebi.www.webservices.chebi.SearchCategory) ChebiWebServiceFault(uk.ac.ebi.www.webservices.chebi.ChebiWebServiceFault) ServiceException(javax.xml.rpc.ServiceException) ChebiWebServicePortType(uk.ac.ebi.www.webservices.chebi.ChebiWebServicePortType) ChebiWebServiceServiceLocator(uk.ac.ebi.www.webservices.chebi.ChebiWebServiceServiceLocator) RemoteException(java.rmi.RemoteException) StarsCategory(uk.ac.ebi.www.webservices.chebi.StarsCategory) LiteEntity(uk.ac.ebi.www.webservices.chebi.LiteEntity)

Aggregations

RemoteException (java.rmi.RemoteException)1 ServiceException (javax.xml.rpc.ServiceException)1 ChebiWebServiceFault (uk.ac.ebi.www.webservices.chebi.ChebiWebServiceFault)1 ChebiWebServicePortType (uk.ac.ebi.www.webservices.chebi.ChebiWebServicePortType)1 ChebiWebServiceServiceLocator (uk.ac.ebi.www.webservices.chebi.ChebiWebServiceServiceLocator)1 LiteEntity (uk.ac.ebi.www.webservices.chebi.LiteEntity)1 SearchCategory (uk.ac.ebi.www.webservices.chebi.SearchCategory)1 StarsCategory (uk.ac.ebi.www.webservices.chebi.StarsCategory)1