title: How to post body of the xml data in android web service?
body: <p>i am trying to post request with xml body to the web service using volley api,but it returns output like invalid credentials.below is my code</p>
  
  <pre><code>StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new com.android.volley.Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String s) {
                  Log.e("onResponse","...."+s);
              }
          }, new com.android.volley.Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError volleyError) {
                  Log.e("onErrorResponse","...."+volleyError);
              }
          }) {
              @Override
              public String getBodyContentType() {
                  return "application/xml; charset=" +
                          getParamsEncoding();
              }
  
              @Override
              protected Map&lt;String, String&gt; getParams() {
                  Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
                  params.put("SLUsername", "uname");
                  params.put("SLPassword", "pwd");
                  params.put("CurrentDate", "date");
                  return params;
              }
  
  
          };
  
  
  
  // Schedule the request on the queue
          queue.add(stringRequest);
      }
  </code></pre>
  
  <p>below is my sample xml body</p>
  
  <pre><code>&lt;GetDetails&gt;
  &lt;SLUsername&gt;Settings Username&lt;/SLUsername&gt;
  &lt;SLPassword&gt;Settings Password&lt;/SLPassword&gt;
  &lt;CurrentDate&gt;Settings Date&lt;/CurrentDate&gt;
  &lt;/GetDetails&gt;
  </code></pre>
  
  <p>How to send this xml body to the api?</p>