/*
 * Main.java
 *
 * Created on September 19, 2007, 1:52 PM
 */

import org.apache.xmlrpc.*;
import java.util.*;

/**
 *
 * @author ink
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        try {
            XmlRpcClientLite client = null;
            XmlRpc.setKeepAlive(false);
            XmlRpc.setDebug(true);
            client = new XmlRpcClientLite("http://someserver.com/some/path");
            // set authentication
            //client.setBasicAuthentication("joe", "pass");
            // and set timeout
            client.setReadTimeout(30000);
            Vector params = new Vector();
	    // setup parameters
            params.add("param 1");
            params.add(new Integer(2));
	    params.add(new Boolean(false));
            Object result = client.execute("Object.someMethod", params);
            if (result != null) {
                System.out.println("Got this back: " + result.toString());
            } else {
                System.out.println("Got NULL back: ");
            }
            System.exit(0);
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

}

