import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
import java.io.*;
import java.net.URL;
  
public class Client
{
	public static void main(String [] args) 
	{
		try 
		{
			System.out.print("Enter Person's Last Name:");
			
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String lastName = reader.readLine();

			String endpoint = "http://localhost:8080/axis/services/Info";
			
			Service service = new Service();
			Call call = (Call) service.createCall();
			
			call.setTargetEndpointAddress(new URL(endpoint));
			call.setOperationName(new QName("http://soapinterop.org", "getRecord"));
			
			String info = (String) call.invoke(new Object[]{lastName});

			call.setOperationName(new QName("http://soapinterop.org", "getFullName"));
			String fullName = (String) call.invoke(new Object[]{lastName});

			System.out.println("Details reterived on " + lastName);
			System.out.println("Full Name:" + fullName);
			System.out.println("Information on record: " + info);
         	}
		catch (Exception e) 
		{
             		System.err.println(e.toString());
		}
	}
}