import java.util.List;

import org.mule.extras.client.MuleClient;
import org.mule.umo.UMOException;
import org.mule.umo.UMOMessage;

import com.ferienclub.leisure.LeisureOffer;
import com.ferienclub.leisure.esb.messages.LeisureQuery;

public class StartLeisurePM {
/*
	public static void main(String[] args){
		try {
			System.out.println("Jetzt gehts los!");
			MuleClient client = new MuleClient();
			UMOMessage result = client.send("axis:http://localhost:8081/axis/services/LeisureManagement?method=getLeisureOffers","95F6B374-9717-478D-A606-15CF8856B1BD",null);
			
			if (o != null){
				LeisureQuery query = (LeisureQuery)o;
				List l = query.getLeisureOffers();
				if (l != null)
				{
					System.out.println(l.size());
				}
			}
		} catch (UMOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}	
	*/
    public static void main(String[] args){
		try {
			System.out.println("Jetzt gehts los!");
			MuleClient client = new MuleClient();
			LeisureOffer offer = new LeisureOffer();
			offer.setName("offer1");
			offer.setFacilityEndpointName("vm://facility1");
			UMOMessage result = client.send("axis:http://localhost:8081/axis/services/LeisureManagement?method=makeBooking",
					 new Object[]{offer,"95F6B374-9717-478D-A606-15CF8856B1BD", new Integer(3), new Boolean(true)},null);
			System.out.println("Finished!");
		} catch (UMOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}	
}
