I work with KSOAP2 but i wish usign Volley and i can't connect a web service with Authentication. I have tried overwriting the method getHeader but in the log shows the following.
E/Volley: [593] BasicNetwork.performRequest: Unexpected response code 500 for http://myservice/register.asmx
this is my code:
public void peticion() {
final RequestQueue queue = Volley.newRequestQueue(this);
StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.e("response", response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("VolleyError", error.getMessage());
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<String, String>();
headers.put("UsuarioName", "user123");
headers.put("UsuarioPass", "123456789");
return headers;
}
};
queue.add(stringRequest);
}
EDIT Fragment the my WebService
<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/MLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Header> <Autenticacion xmlns="http://tempuri.org/"> <suarioPass>string</UsuarioPass> <UsuarioName>string</UsuarioName> </Autenticacion> </soap12:Header>
with ksoap work but with volley no.
-The data are correct
-The service work
I dont understand why not work with volley
Thank you for your help
Volley don't support Protocol SOAP