URL Restful service working, but on ANDROID returns null

Asked

Viewed 88 times

0

I’m trying to develop a service Rest for my father’s store, I’m able to bring the results in JSON through the URL, but when I try to execute the same method on android to try to fill the object, it returns null, already debugged and I can go to the method that makes the SELECT in the bank, it brings the right list, filled.. The problem is on the android side, I can not map the result... Anyone can say what can be??!!

Follow the methods:

public List<Produto> getProdutosPromocionais(boolean promocional, double preco) {
    return ClienteRest.builder().path("produtos").path("promocionais").path(promocional).path(preco).build().listar(Produto.class);
}

    @GET
    @Path("/promocionais/{promocional}/{preco}")
    @AddLinks
    public List<Produto> getProdutosPromocionais(@PathParam("promocional") boolean promocional, @PathParam("preco") double preco) {
        return servico.getProdutosPromocionais(promocional, preco);
    }

the queries are correct, the URL works, but on the android side returns NULL..

  • Hello, could you please post the code snippet on which you make the call to your API?

  • posted up there

  • When you make the same message in the browser, what is the result? Also, how do you make the call on android? Try further to make the problem playable.

  • when I call in the browser, brings the right list of objects.. in doInBackground() I try to fill a list using the service method, other methods work, only this one that is returning null

  • Resourcelinks are necessary if there are children objects?

  • Maybe the call you make through the Android is returning special characters, which invalidates all return.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.