Search code examples
androidsoapksoap

Android SOAP null response, dump = correct XML with needed data, XMLPullParser exception


What is incorrect in my SOAP request using ksoap in Android if I get BodyIn response = null; Response dump = correct XML with needed data, and XMLPullParser exception:

expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <{https://schemas.xmlsoap.org/soap/envelope/}s:Envelope>

Request dump:

<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
  <v:Header />
  <v:Body>
    <XMLDataGet xmlns="http://tempuri.org/">
      <entity>persona</entity>
      <last_update_date>20140101</last_update_date>
      <country>UA</country>
      <user>someuser</user>
    </XMLDataGet>
  </v:Body>
</v:Envelope>

Solution

  • the problem was in response XML that contained <s:Envelope xmlns:s="https://schemas.xmlsoap.org/soap/envelope/"> but not <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> as it should be.

    So I fixed that by catching InputStream and replacing https with http