import java.net.URL;
import org.apache.xmlrpc.client.XmlRpcClient;
import
org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import
org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory;
public class Client {
public static void main(String[] args) throws Exception {
// create configuration
XmlRpcClientConfigImpl config = new
XmlRpcClientConfigImpl();
config.setServerURL(new URL("http://127.0.0.1:8080/xml_rpc_web/bbaeggar"));
config.setEnabledForExtensions(true);
config.setConnectionTimeout(60 * 1000);
config.setReplyTimeout(60 * 1000);
XmlRpcClient client = new XmlRpcClient();
// use Commons HttpClient as transport
client.setTransportFactory(
new
XmlRpcCommonsTransportFactory(client));
// set configuration
client.setConfig(config);
// make the a regular call
Object[] params = new
Object[]
{ new Integer(2), new Integer(3) };
Integer result = (Integer) client.execute("Calculator.add", params);
System.out.println("2 + 3 = " + result);
for(int i = 0;i<100;i++) {
// make the a regular call
Object[] params1 = new Object[]
{ "bbaeggar",
"0000" };
Boolean result1 = (Boolean)
client.execute("Login.login", params1);
System.out.println("is Login = " + result1);
}
}
}