Hi,
How do you know what the correct cast type is for the return of a request?
I have the following piece of code:
[code]
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
try {
config.setServerURL(new
URL("https://{aServer}/svcmon/RPC/server.php"));
}
catch (MalformedURLException mue) {
addItem("MalformedURLException " + mue);
System.exit(-1);
}
addItem("XmlRpcClientConfigImpl created");
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Object[] params = new Object[]{};
try {
String result =
(String)client.execute("organisation.getAllOrganisations", params);
addItem("Read 'result' " + result.getClass().getName());
}
catch (ClassCastException cce) {
addItem ("ClassCastException: " + cce);
System.exit(-1);
}
catch (XmlRpcException xre) {
addItem("XmlRpcException: invocation of the remote method
failed");
addItem("XmlRpcException.getLocalizedMessage returned: " +
xre.getLocalizedMessage());
System.exit(-2);
}
[/code]
This code generates the following output:
Creating XmlRpcClientConfigImpl
XmlRpcClientConfigImpl created
ClassCastException: java.lang.ClassCastException: [Ljava.lang.Object; cannot
be cast to java.lang.String
What I was expecting (and saw on a comparable request using Phyton command
line) was:
['customer01', 'customer02', 'customer03, ... , 'customer0N'].
Anyone know what is wrong in my code?
TIA,
Abel
--
View this message in context:
http://www.nabble.com/XML-RPC-and-casting-the-correct-type-tp14797401p14797401.html
Sent from the Apache Xml-RPC - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]