-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleXMLRPCClient.java
More file actions
38 lines (29 loc) · 1 KB
/
Copy pathSimpleXMLRPCClient.java
File metadata and controls
38 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Simple XMLRPC Client using Apache's XML-RPC library
*
* Author: Mehmet Gencer, mgencer@cs.bilgi.edu.tr
*
*/
import org.apache.xmlrpc.*;
import java.util.*;
public class SimpleXMLRPCClient{
// this method returns a string
public static void main(String args[]){
String input1= args[0];
String input2= args[1];
String input3= args[2];
try{
XmlRpcClient xmlrpc = new XmlRpcClient (input1+"/"+input2);
Vector<Integer> params1 = new Vector <Integer>();
//Vector params = new Vector<>();
//params.addElement ("a string parameter");
params1.addElement(Integer.parseInt(input3));
//String result = (String) xmlrpc.execute ("c.power", params);
int powerOfFunction = (int) xmlrpc.execute ("myhandler.power", params1);
System.out.println(powerOfFunction);
//System.out.println(result);
}catch(Exception e){
System.out.println(e);
}
}
}