Question: I have a Python XML-RPC server that has a function that returns a tuple, e.g: 

```
def function_name(first_parameter, second_parameter)
    #do something
    return (x,y)

```

I'm calling this function from Java in an Android application using [aXMLRPC](https://www.timroes.de/2013/06/13/axmlrpc-a-lightweight-xml-rpc-library-for-android/), the code is:

```
Object id = client.call("function_name", first_parameter, second_parameter);

```

How can I extract the two return values of the function from the Object id?

Answer: 
[The documentation](https://github.com/timroes/aXMLRPC) for the XML-RPC library you're using to talk to the Python service says that there are only a limited number of possible return types; I don't know for sure without trying it, but clearly your Tuple is going to come back either as an array or perhaps as a `Map<String, Object>`. You're going to have to experiment a little but it shouldn't be too bad. Try something like this:

```
Object id = client.call("function_name", first_parameter, second_parameter);
System.out.println(id.getClass().getName());

```

to find out what you're dealing with, and then once you know, you can write the real code accordingly. Most likely, `id` will turn out to be an `Object[2]` containing the two values.
I believe if you use [this library](http://grepcode.com/file/repo1.maven.org/maven2/org.python/jython/2.2/org/python/parser/ast/Tuple.java) you can cast you Object id into a Tuple and then use methods inside to parse