开发者

Restlet On Android - Issues with serialization

开发者 https://www.devze.com 2023-01-25 10:43 出处:网络
I am trying to retrieve serialized classes using Restlet 2.1 with Android as the client and GAE as the server. This is the relevant code:

I am trying to retrieve serialized classes using Restlet 2.1 with Android as the client and GAE as the server. This is the relevant code:

ClientResource cr = new ClientResource("http://localhost:8888/mydata");
// Get the MyData object
MyDataResource resource = cr.wrap(MyDataResource.class);
MyData myData = resource.retrieve();

I initially tested this in a standalone JSE class, and everything worke开发者_Python百科d fine. When I try to run the same thing in Android, the myData object is null. Any ideas?


You can check here the Android specificities: RESTLet android page

I spent few hours before to understand the problem as well, you need to explicitly register the Jackson convertor like that :

Engine.getInstance().getRegisteredConverters().add(new JacksonConverter());
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号