Hi,
I've come across a weird problem using the restlet android client. It would
appear the client always returns null when calling the retrieve() method. The
weird part is that the call is actually registered on the GAE server and it
actually returns a non-null User object.
Here's the client part:
ClientResource cr=new
ClientResource("http://10.0.2.2:8888/rest/users/test");
cr.setRequestEntityBuffering(true);
UserResource r=cr.wrap(UserResource.class);
r.retrieve();
And the server resource:
@Override
public User retrieve() {
String username=(String)getRequest().getAttributes().get("username");
User u = userdao.getUser(username); //reads user from datastore
return u; //u is not null
}
I've accidentally found a weird workaround for this problem:
@Override
public User retrieve() {
String username=(String)getRequest().getAttributes().get("username");
User u = userdao.getUser(username); //reads user from datastore
return new User(u.getKey(),u.getUsername(),u.getPassword();
}
That's the only way I've managed to get a non-null object to the android client.
So my real problem now is returning an ArrayList<User>.
Any help would be appreciated.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2910309