package com.agiledeveloper.ws;

import com.agiledeveloper.xmlprocessing.InfoReader;

public class InformationProvider
{
	public String getFullName(String lastname)
	{
		// Typically we would access this information from a database. To keep things simple,
		// we will fetch information from a xml document.
		// The document is assumed to be located in c:\temp\data directory.

		String result = "No record found";

		try
		{
			InfoReader reader = new InfoReader(lastname);
			result = reader.getFullName();
		}
		catch(Exception ex)
		{
			result = ex.toString();
		}

		return result;
	}

	public String getRecord(String lastname)
	{
		// Typically we would access this information from a database. To keep things simple,
		// we will fetch information from a xml document.
		// The document is assumed to be located in c:\temp\data directory.

		String result = "No record found";

		try
		{
			InfoReader reader = new InfoReader(lastname);
			result = reader.getRecord();
		}
		catch(Exception ex)
		{
			result = ex.toString();
		}

		return result;
	}
}