// WE ARE USING APACHE AXIS (http://ws.apache.org/axis/) TO HANDLE ALL THE SOAP

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
import java.util.Hashtable;

// AN EXAMPLE CLASS THAT SENDS TWO QUERY PARAMETERS (ORGANISM AND MPATH ID) TO PATHBASE AND OUTPUTS IMAGE NUMBERS AS RESULT

public class Pathbase2SOAPClient_SearchPathbase_String
{
	public static void main(String [] args)
	{
		try
		{
			//CREATE A WEB SERVICE OBJECT WITH THE SPECIFIED URL
			
			String endpoint =
				"http://pathbase1.pdn.cam.ac.uk/axis/Pathbase2_SOAP.jws";
			Service  service = new Service();
			Call     call    = (Call) service.createCall();
			call.setTargetEndpointAddress( new java.net.URL(endpoint) );
			call.setOperationName(new QName("http://pathbase1.pdn.cam.ac.uk/", "searchPathbase") );
			
			
			// CREATE THE STRINGS WITH THE QUERY ARGUMENTS
			String magnification="";String stain="";String organism="Rat";String sex="";String strain="";String gene="";String emap="";String cl="";String mpath="458";String ma="";String go="";String genotype_status="";String genetic_manipulation="";String designated_allele_name="";String experimental_manipulation="";String description="";String tbase="";String pubmed="";String series_number="";String submitter_id="";String source_reliability="";
			
			
			// SEND THE STRINGS TO  THE WEB SERVICE AND OUTPUT THE RESULT
			
			String[] ret=(String[])call.invoke(new Object []{magnification, stain, organism, sex, strain, gene, emap, cl, mpath, ma, go, genotype_status, genetic_manipulation, designated_allele_name, experimental_manipulation, description, tbase, pubmed, series_number, submitter_id, source_reliability});
			String n1 = (String)ret[1];
			String n2 = (String)ret[2];
			String n5 = (String)ret[0];
			System.out.println(n1+"|"+n2+"|"+n5);

		}
		catch (Exception e)
		{
			System.err.println(e.toString());
		}
	}
}