How to make XML api request with header, body and params?
<p>I am following using <a href="http://%3Chttps://gist.github.com/itsalif/6149365%3E" rel="nofollow">https://gist.github.com/itsalif/6149365</a> library for making XML requests. 
It uses Simple-XML for serialising XML to Objects. </p>

<p>I am able to make XML request successfully when there is no header and parameters associate with the SOAP api. However I am unable get response while performing little complex request which consist of header and parameters.</p>

<p><strong>My request format looks like this</strong></p>

<pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
 &lt;SOAP-ENV:Body&gt;
   &lt;ns1:GetHolidaysAvailable&gt;
     &lt;ns1:countryCode&gt;UnitedStates&lt;/ns1:countryCode&gt;
   &lt;/ns1:GetHolidaysAvailable&gt;
 &lt;/SOAP-ENV:Body&gt;
&lt;/SOAP-ENV:Envelope&gt;
</code></pre>

<p><strong>Code</strong></p>

<pre><code>HashMap&lt;String, String&gt; mapData = new HashMap&lt;&gt;();
final String mRequestBody = "&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://www.holidaywebservice.com/HolidayService_v2/\"&gt;\n" +
        " &lt;SOAP-ENV:Body&gt;\n" +
        "   &lt;ns1:GetHolidaysAvailable&gt;\n" +
        "     &lt;ns1:countryCode&gt;UnitedStates&lt;/ns1:countryCode&gt;\n" +
        "   &lt;/ns1:GetHolidaysAvailable&gt;\n" +
        " &lt;/SOAP-ENV:Body&gt;\n" +
        "&lt;/SOAP-ENV:Envelope&gt;";

SimpleXmlRequest dellaRequest = new SimpleXmlRequest&lt;String&gt;
        (Request.Method.POST, "http://www.holidaywebservice.com//HolidayService_v2/HolidayService2.asmx?wsdl", String.class, headerDataMap, bodyDataMap,
                new Response.Listener&lt;String&gt;() {
                    @Override
                    public void onResponse(String response) {

                        Log.d("BaseActivity", "response = " + response.toString());

                    }
                },
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {

                        Log.d("BaseActivity", "Error:" + error.getMessage());

                    }
                }
        ){
    @Override
    public byte[] getBody() throws AuthFailureError {

        try {
            return mRequestBody == null ? null : mRequestBody.getBytes("utf-8");
        } catch (UnsupportedEncodingException uee) {
            VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s",
                    mRequestBody, "utf-8");
            return null;
        }
    }
};
</code></pre>

<p>I am getting 400 response code i.e. <strong>BAD REQUEST</strong>, state that invalid input is provided e.g validation error or missing data.</p>

<p>This api working fine in Postman rest client. So I am not able to figure out what am I doing wrong.</p>