Thanks for your help Stano,
I try to access the object by index, (people[0]) but I get an index out
of bounds exception.
Is there a way I can set debug on the response to see the raw method
response?
Thanks.
On 4/26/10 3:12 PM, Stanislav Miklik wrote:
Hi,
since you don't get a class cast exception, everything seems to be working
as it should be.
in your print you probably get something like [Ljava.lang.Object;@1100d7a
but this means that you have array of Objects
Thus you can access the first person as people[0].
The corresponding type will be based on how the "array of people" was
constructed.
BR
Stano
On Mon, Apr 26, 2010 at 20:44, David J.<da...@styleflare.com> wrote:
How do I access an Array that is returned in a HashMap?
The server returns a HashMap with the following values
{responseCode=OK,people=[Array of People]}
I cast the response to a HashMap which then lets me access the objects by
key,
although the Array simple returns Object, and I cant access the Data.
ie I call
HashMap response = (HashMap)client.execute("myMethod",param);
String responseCode = (String)response.get("responseCode");
System.out.println(responseCode); (Prints "OK");
Object[] people = (Object[]) response.get("people");
System.out.println(people); (Prints java.lang.Object);
Anyone can help me?