Different return values types from custom API

Sometimes type of handleResponse parameter objects has unexpected type.
Incorrect result (ArrayList contains HashMaps):
http://support.backendless.com/public/attachments/5376af036e0264edc28a10fb0fa9e547.png</img>
Correct result (ArrayList contains ListChallengeApi objects):
http://support.backendless.com/public/attachments/0f3b8fb6276ce46e02028f2f93758936.png</img>
This two queries queried one by one with some minutes time interval without any changes (data, client code, api code, settings - nothing changes!)
In custom api class method looks:
http://support.backendless.com/public/attachments/0f207290ec2c4d299b44190ac5ee9dd5.png</img>
I can’t any possibility to cast HashMap to ListChallengeApi and vice versa, because this code can’t be built.
Can somebody explain me this situation and propose some fixes for guarantee only ListChallengeApi objects in response?
Maybe exists way to convert HashMap to ListChallengeApi manually?

Try adding the following method call before you invoke your service:

Backendless.Data.mapTableToClass( “ListChallengeApi”, ListChallengeApi.class );

I’m sorry that I missed that: ListChallengeApi is not table. Just simple object. Totally equal on client and server, packages equal too (because with different packages it is now work at all).

It is ok if it is not a table. Have you tried if it works after adding the “mapTableToClass” call?

Hmmm. However your advice may be helpful. I added mapTableToClass - all is ok, but I continue testing… Thank you.

On no. Again( reproduced problem just now.

Do you call Backendless.initApp in more than one place?

No. Only in onCreate() of class extends Application.

Are you saying exactly the same invocation, with exactly the same arguments, results in different responses? One with HashMap and another with instances of ListChallengeApi ?

Yes, exactly.

Please send the code for ListChallengeApi class to support@backendless.com and let us know your application ID.

Sent.

Thanks, we got it.

    What is the name of the service you invoke? What is the name of the method? What are the argument values?

I sent this info with email.

Thanks. Please change the “mapTableToClass” as shown below:

Backendless.Data.mapTableToClass( “com.mbaas.services.ListChallengeApi”, ListChallengeApi.class );

I’ll try it and write results tomorrow.

It seems to be working. Thank you for help and fast responses.