Hi,
I need to get a user's roster in java. Using the following method, the RPC call executes with success yet will not cast to anything usable beyond a HashMap(see comment).
Could someone please point me in the right direction?
public static String getRoster(String user) {
try {
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(Setup.RPC));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
/* Command string */
String command = "get_roster";
/* Parameters as struct */
Map struct = new HashMap();
struct.put("user", user);
struct.put("host", Setup.IM_DOMAIN);
Object[] params = new Object[]{struct};
Object o = client.execute(command, params);
// CAN cast to a HashMap, with key 'contacts' yet I can not get the value to cast to anything beyond an Object...
return "";
} catch (Exception e) {
return "-1";
}
}
Regards,
Dylan