Post soap xml request with Retrofit
<p>I am trying to post an soap xml with Retrofit but it's failing, I'm using a Simple XML Framework to model a SOAP request that looks like this: </p>

<p><strong>Request XML</strong></p>

<pre><code>@Root(name = "soap12:Envelope")
@NamespaceList({
        @Namespace(reference = "http://www.w3.org/2001/XMLSchema-instance", prefix = "xsi"),
        @Namespace(reference = "http://www.w3.org/2001/XMLSchema", prefix = "xsd"),
        @Namespace(prefix = "soap12", reference = "http://www.w3.org/2003/05/soap-envelope")
})
@Element(name = "soap12:Body")
public class GeoIP {

    @Namespace(reference = "http://www.webservicex.net/")
    @Element(name="GetGeoIP")
    private GetGeoIP GetGeoIP;

    public GetGeoIP getGetGeoIP() {
        return GetGeoIP;
    }

    public void setGetGeoIP(GetGeoIP getGeoIP) {
        this.GetGeoIP = getGeoIP;
    }

    @Namespace(reference = "http://www.webservicex.net/")
    public static class GetGeoIP{
        @Element(name = "IPAddress")
        private String IPAddress;

        public String getIP() {
            return IPAddress;
        }

        public void setIP(String IP) {
            this.IPAddress = IP;
        }
    }
}
</code></pre>

<p><strong>Expected output:</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"&gt;
  &lt;soap12:Body&gt;
    &lt;GetGeoIPResponse xmlns="http://www.webservicex.net/"&gt;
      &lt;GetGeoIPResult&gt;
        &lt;ReturnCode&gt;int&lt;/ReturnCode&gt;
        &lt;IP&gt;string&lt;/IP&gt;
        &lt;ReturnCodeDetails&gt;string&lt;/ReturnCodeDetails&gt;
        &lt;CountryName&gt;string&lt;/CountryName&gt;
        &lt;CountryCode&gt;string&lt;/CountryCode&gt;
      &lt;/GetGeoIPResult&gt;
    &lt;/GetGeoIPResponse&gt;
  &lt;/soap12:Body&gt;
&lt;/soap12:Envelope&gt;
</code></pre>

<p><strong>Failure Output</strong></p>

<pre><code>&lt;--- HTTP 500 http://www.webservicex.net/geoipservice.asmx (2240ms)
06-15 08:22:09.567 26327-26359/com. D/Retrofit: : HTTP/1.1 500 Internal Server Error
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: Cache-Control: private
06-15 08:22:09.567 26327-26359/com.a.mfmpay D/Retrofit: Content-Length: 1188
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: Content-Type: text/xml; charset=utf-8
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: Date: Wed, 15 Jun 2016 03:22:00 GMT
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: OkHttp-Received-Millis: 1465960929564
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: OkHttp-Response-Source: NETWORK 500
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: OkHttp-Selected-Protocol: http/1.1
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: OkHttp-Sent-Millis: 1465960928849
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: Server: Microsoft-IIS/7.0
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: X-AspNet-Version: 4.0.30319
06-15 08:22:09.567 26327-26359/com.a D/Retrofit: X-Powered-By: ASP.NET
                                                                  at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp;amp; abortProcessing)&lt;/faultstring&gt;&lt;detail /&gt;&lt;/soap:Fault&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;
06-15 08:22:09.570 26327-26359/com.a D/Retrofit: &lt;--- END HTTP (1188-byte body)
06-15 08:22:09.571 26327-26327/com.a V/TAG: 500 Internal Server Error
</code></pre>

<p><strong>EndPoint Interface</strong></p>

<pre><code>public interface MagentoApi {
@Headers({"Content-Type: application/soap+xml; charset=utf-8"})
    @POST("/geoipservice.asmx")
    public void requestGeo(@Body GeoIP.GetGeoIP body,Callback&lt;GeoIPResponse&gt; cb);
}
</code></pre>

<p><strong>Main Class Code</strong></p>

<pre><code>    GeoIP.GetGeoIP request = new GeoIP.GetGeoIP();
        request.setIP("192.168.1.1");

        RestAdapter restAdapter = getRestAdapter();
        MagentoApi api = restAdapter.create(MagentoApi.class);

        api.requestGeo(request, cb);

retrofit.Callback&lt;GeoIPResponse&gt; cb = new retrofit.Callback&lt;GeoIPResponse&gt;() {
    @Override
    public void success(GeoIPResponse geoIPResponse, retrofit.client.Response response) {
        Log.v("TAG", String.valueOf(response.getStatus()));
    }

    @Override
    public void failure(RetrofitError error) {
Log.v("TAG",error.getLocalizedMessage());
    }
};
    public static RestAdapter getRestAdapter() {
        Strategy strategy = new AnnotationStrategy();
        Serializer serializer = new Persister(strategy);

        OkHttpClient okHttpClient = new OkHttpClient();
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setEndpoint("http://www.webservicex.net")
                .setClient(new OkClient(okHttpClient))
                .setConverter(new SimpleXMLConverter(serializer))
                .setLogLevel(RestAdapter.LogLevel.FULL)
                .build();

        return restAdapter;
    }
</code></pre>