com.android.volley.ClientError

1

I have this problem:

using volley to connect to an ASP.Net web service in this way, I jump to the onErrorResponse with the message "com.android.volley.ClientError " In local yes it works for me

    requestQueue = Volley.newRequestQueue(this);

    Map<String, String > params = new HashMap();
    params.put("userName", userTextView.getText().toString());
    params.put("userPass", passTextView.getText().toString());

    JSONObject parametros = new JSONObject(params);

    JsonObjectRequest jsonObjectRequest = null;

    jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, WebserviceConnection.getAbsoluteUrl("usuarios/"), parametros, new Response.Listener<JSONObject>() {
        @Override
        public void onResponse(JSONObject response) {

            UsuarioObject usuario = new UsuarioObject(response);

            checkUser(usuario);
        }

    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {

            Log.d("Login", "Error Respuesta en JSON: " + error.getMessage());
        }
    });

    requestQueue.add(jsonObjectRequest);
    
asked by Juan 23.04.2018 в 11:41
source

1 answer

1

Since you say local works for you, then check your URL: WebserviceConnection.getAbsoluteUrl("usuarios/") , it is very likely that it is not correct or not functional in your environment, because it does not point to a valid resource or that is being created poorly.

    
answered by 23.04.2018 в 12:52