throws IOException {
Range toleranceRange = mzTolerance.getToleranceRange(mass);
MetlinServiceLocator locator = new MetlinServiceLocator();
MetlinPortType serv;
try {
serv = locator.getMetlinPort();
} catch (ServiceException e) {
throw (new IOException(e));
}
// Search mass as float[]
float searchMass[] = new float[]{(float) toleranceRange.getAverage()};
float searchTolerance = (float) (toleranceRange.getSize() / 2.0);
final String token = parameters.getParameter(
MetLinParameters.SECURITY_TOKEN).getValue();
MetaboliteSearchRequest searchParams = new MetaboliteSearchRequest(
token, searchMass, adduct, searchTolerance, "Da");
LineInfo resultsData[][];
try {
resultsData = serv.metaboliteSearch(searchParams);
} catch (AxisFault e) {
// For some reason, the METLIN SOAP gateway throws AxisFault caused
// by ArrayStoreException if no result is found. I suspect their
// SOAP response is malformed and Axis does not like it.
resultsData = new LineInfo[1][0];