Hi,

I am trying to consume a webservice in Spring from my application codename.
It returns the following error:

{"timestamp": 1584914466134, "status": 400, "error": "Bad Request", 
"exception": 
"org.springframework.web.bind.MissingServletRequestParameterException", 
"message": "Required Long parameter 'id' is not present "," path ":" / 
visit / start "}

I imagine it is trivial, but so far I have not been able to correct it.

*My calla in Codenameone*
    public static Response inicio(Visita v) {
        Response<String> r = Rest.post(SERVER_URL + "visita/inicio").
                header("token", UsuarioService.getToken()).
                jsonContent().
                queryParam("id", Long.toString(v.visitaId.get())).
                queryParam("fecha", 
Long.toString(System.currentTimeMillis())).
                getAsString();
        return r;
    }

*My Webservice*
    @RequestMapping(method = RequestMethod.POST,value = "/inicio")
    public @ResponseBody String inicioVisita(
    @RequestHeader(name="token", required = true) String token,
    @RequestParam(value="id", required = true) Long id,
    Long fecha) {
    visitas.inicioVisita(token, id, fecha);
    return "OK";
    }

-- 
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/2ad7949b-e0c5-4b16-a5fd-ed0f0ab6196b%40googlegroups.com.

Reply via email to