By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,312 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,312 IT Pros & Developers. It's quick & easy.

question about xmlrpc server: returning a list of lists to a Java client?

P: n/a
I have a simple xmlrpc server/client written in Python, and the client
throws a list of lists to the server and gets back a list of lists.
This runs without a problem.

I then wrote a simple Java xmlrpc client and it calls the python
server. But I can't figure out what type to cast the result (of type
Object) to. The Java xmlrpc call is basically this:
Object result = client.execute("MyFunction", params);
And I tried to replace that line with

Vector result = (Vector) client.execute("MyFunction", params);

and

ArrayList result = (ArrayList) client.execute("MyFunction", params);

and both gave me java.lang.ClassCastException.

I'm really not a Java expert - anyone can give a hint or two?

(NOTE the java client/python server works well when the returning
result is of type string - so this rules out some other possible
problems)

Thanks a lot!

Oct 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

fortepianissimo wrote:
I have a simple xmlrpc server/client written in Python, and the client
throws a list of lists to the server and gets back a list of lists.
This runs without a problem.

I then wrote a simple Java xmlrpc client and it calls the python
server. But I can't figure out what type to cast the result (of type
Object) to. The Java xmlrpc call is basically this:
Object result = client.execute("MyFunction", params);
And I tried to replace that line with

Vector result = (Vector) client.execute("MyFunction", params);

and

ArrayList result = (ArrayList) client.execute("MyFunction", params);

and both gave me java.lang.ClassCastException.

I'm really not a Java expert - anyone can give a hint or two?

(NOTE the java client/python server works well when the returning
result is of type string - so this rules out some other possible
problems)

Thanks a lot!
Ok I'll answer to myself: found this message

http://mail-archives.apache.org/mod_...ilson.co.uk%3E

Basically it's introduced by a bug in Apache XMLRPC 3.0a1
implementation.

Anyone knows any update on this please do post up (the message was
dated in March 2006) - appreciate it!

Oct 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.