Hi,
I am trying to consume a webservice using the restful API. It correctly
returns the information I request:
data => [{usuarioid=17, usuario=demo1, nombreempresa=Embutidora Nacional,
impuesto=7, menuid=1, dispositivoid=4, leehuella=1, imei=55555,
[email protected], nombre=Usuario Embutidos, radio=300,
fuenteinventario=A, permitecambiarfoto=1, iniciosesion=1,
contrasena=202cb962ac59075b964b07152d234b70, rangoinicio=100001,
rangofin=150000, secuenciaorden=100054, estado=A,
token=0a5b3d4a-5b8f-443d-af8e-cfb4100b71c4}]
To consume I do the following:
public static void login(Idioma idioma, String usuario, String contrasena,
final SuccessCallback<Usuario> onSuccess, final FailureCallback<Object>
onError) {
Rest.get(SERVER_URL +
"blank_ws_autenticar/blank_ws_autenticar.php").
acceptJson().
queryParam("contrasena", contrasena).
queryParam("usuario", usuario).
getAsJsonMapAsync(new Callback<Response<Map>>() {
@Override
public void onSucess(Response<Map> value) {
usr = new Usuario();
PreferencesObject.create(usr).bind();
*
usr.getPropertyIndex().populateFromMap(value.getResponseData())*;
onSuccess.onSucess(usr);
}
@Override
public void onError(Object sender, Throwable err, int
errorCode, String errorMessage) {
onError.onError(null, err, errorCode, errorMessage);
}
});
}
I cannot pass the information through the property "populateFromMap"
What is the correct way to do it?
Thanks
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/84cf7545-bdeb-41ea-9843-c198d6abe050n%40googlegroups.com.