getIsolateFields
Description: Returns isolate fields defined for database.
Arguments
- database (string)
Sample Perl code
#!/usr/bin/perl #Written by Keith Jolley use SOAP::Lite; use strict; use warnings; #####Sample arguments######### my $database = 'neisseria'; ############################## my $soap = SOAP::Lite -> uri('http://pubmlst.org/MLST') -> proxy('http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl'); my $soapResponse = $soap->getIsolateFields($database); unless ($soapResponse->fault){ for my $soapData ($soapResponse->dataof('//fieldDef')) { my $desc = $soapData->value->{'description'}; $desc = "-" if !$desc; print "Field: " . $soapData->value->{'name'} . "; Type: " . $soapData->value->{'type'} . "; Description: " . $desc . "\n"; } } else { print join ', ',$soapResponse->faultcode,$soapResponse->faultstring; }
Sample Java code
package org.pubmlst.mlstSOAP; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import javax.xml.namespace.QName; import java.util.Vector; public class GetIsolateFields { public static void main(String[] args) { //Sample arguments//////////////// String database = "neisseria"; ////////////////////////////////// try { String endpoint = "http://pubmlst.org/cgi-bin/mlstdbnet/mlstFetch.pl"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setOperationName(new QName("http://pubmlst.org/MLST/", "getIsolateFields")); call.addParameter("database",org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.setReturnType(org.apache.axis.Constants.SOAP_VECTOR); Vector ret = (Vector) call.invoke(new Object[] { database }); for (int i=0; i<ret.size(); i++){ Vector field = (Vector)ret.get(i); String desc; try { desc = (String) field.get(2); } catch (ArrayIndexOutOfBoundsException e){ desc = "-"; } System.out.println("Field: " +field.get(0) + ": " + "Type: " + field.get(1) + "Description: " + desc); } } catch (Exception e) { System.err.println(e.toString()); } } }
Output
Field: id; Type: integer; Description: primary key Field: strain; Type: text; Description: strain name Field: other_name; Type: text; Description: alternative strain name Field: ST; Type: integer; Description: sequence typeetc ...