【问题标题】:Android SOAP null response, dump = correct XML with needed data, XMLPullParser exceptionAndroid SOAP 空响应,转储 = 正确的 XML 和所需数据,XMLPullParser 异常
【发布时间】:2014-07-08 08:46:12
【问题描述】:

如果我得到 BodyIn response = null; 在 Android 中使用 ksoap 的 SOAP 请求有什么问题?响应转储 = 包含所需数据的正确 XML,以及 XMLPullParser 异常:

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

请求转储:

<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>

【问题讨论】:

    标签: android soap ksoap


    【解决方案1】:

    问题在于响应 XML 中包含 &lt;s:Envelope xmlns:s="https://schemas.xmlsoap.org/soap/envelope/"&gt; 但不是应有的 &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;

    所以我通过捕获 InputStream 并将 https 替换为 http 来解决这个问题

    【讨论】:

    • 我的代码现在也遇到了同样的问题...有没有办法可以将您的代码发送给我,以便我查看它,我被卡住了,无法弄清楚是什么继续...:/
    • @bbesase 请在 stackoverflow 上发布一个问题,我会用你需要的所有信息回答它
    • 抱歉,整个周末都没有延迟。 stackoverflow.com/questions/24919148/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    • 1970-01-01
    • 2012-07-24
    • 1970-01-01
    相关资源
    最近更新 更多