I want make to make soap post request using Volley library. I am using the following code and got error "HTTP/1.1 400 Bad Request". In previous I am using Soap library working fine but I need to make request using Volley library.I am using following url "http://test.com/TestApp/Services/service.asmx?op=ForgotPassword"
public void forgotPassword(final String userName,String url) {
StringRequest sr = new StringRequest(Request.Method.POST,
url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(mContext, "Success" + response,
Toast.LENGTH_SHORT).show();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
showResponse(error);
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("Email", userName);
params.put("Language", "en");
return params;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("Content-Type", "application/x-www-form-urlencoded");
params.put("Content-Length", "length");
return params;
}
};
Application.getInstance().getRequestQueue().add(sr);
}
Please help me to make post soap request with volley.