XML-RPC - java.lang.ClassCastException: java.util.Date error during execute

M

mgalaty

Hello,

I am getting an error "XML-RPC - java.lang.ClassCastException:
java.util.Date" when I call the "XmlRpcClient" execute method. I
believe the underlying classes are having trouble parsing the result
from the time.xmlrpc.com/RPC2:80 XML-RPC service.

I apologize that I could not navigate the Apache bug reporting and
search system. I hope someone can recognize what is up with this.

Thank you in advance for any help,

Michael

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

public class GetTime {
private final static String server_url
="http://time.xmlrpc.com/RPC2";
public static void main (String [] args) {
try {

XmlRpcClient server = new XmlRpcClient(server_url);
Vector params = new Vector();

System.out.println("Calling execute method ");
Hashtable response = new Hashtable();
response = (Hashtable)
server.execute("currentTime.getCurrentTime",params);
System.out.println("Time is: ");

} catch (XmlRpcException exception) {
System.err.println("GetTime1: XML-RPC Fault #" +
Integer.toString(exception.code) + ": " + exception.toString());

} catch (Exception exception) {
System.err.println("GetTime2: " + exception.toString());
}
}
}

Note: This is similar to this post, but NOT the same.
http://groups.google.com/groups?hl=...04081102.10e66eb4%40posting.google.com&rnum=1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top