public HttpResponseMessage GetByDni(JObject data) { String token = AccountController.GetTokenHeader(Request); string mensaje; int codigoError; try { Debug.Print("----- START ws getByDni ----"); var dni = data.GetValue("dni").Value <string>(); var user = data.GetValue("user").Value <string>(); ConsultaService service = new ConsultaService(); var results = service.ConsultarDni(dni, user, out mensaje, out codigoError); RestDataResponse response = new RestDataResponse(results, RestDataResponse.STATUS_OK, mensaje); Debug.Print("----- END ws getByDni ----"); CRUDConsultaDbUtil.SaveConsulta(token, Constants.CONSULTA_DNI_ID, data.ToString(), codigoError.ToString(), mensaje); return(this.Request.CreateResponse(HttpStatusCode.OK, response)); } catch (Exception e) { Debug.Print(e.Message); Debug.Print(e.StackTrace.ToString()); CRUDConsultaDbUtil.SaveConsulta(token, Constants.CONSULTA_DNI_ID, data.ToString(), RestDataResponse.STATUS_ERROR.ToString(), "Error: " + e.Message); return(this.Request.CreateResponse(HttpStatusCode.InternalServerError, ErrorMessagesUtil.error())); } }