【问题标题】:Android how I can parse and consume webservices?Android 如何解析和使用 Web 服务?
【发布时间】:2015-01-24 21:01:03
【问题描述】:

如何在 android 中解析这种类型的 web 服务?请看下面的图片。我在 .net 中创建了这个 Web 服务,现在我想在 Android 中解析和使用该登录 Web 服务。请任何人帮助它,将不胜感激。谢谢

SOAP 1.1

 The following is a sample SOAP 1.1 request and response. The placeholders shown need to be  replaced with actual values.

POST /Service.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Login"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
 <Login xmlns="http://tempuri.org/">
  <username>string</username>
  <password>string</password>
  <apptypecode>string</apptypecode>
  </Login>
 </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
 <LoginResponse xmlns="http://tempuri.org/">
  <LoginResult>string</LoginResult>
 </LoginResponse>
 </soap:Body>
 </soap:Envelope>

【问题讨论】:

  • 请删除图片。只需发布几个带有文本的代码块。使用 cpy/paste。
  • @greenapps 好的,等一下 :)
  • @greenapps 我更新了我的问题..

标签: android web-services soap xml-parsing android-ksoap2


【解决方案1】:

【讨论】:

  • Anthone 感谢您的回复,请您建议我使用登录屏幕 web 服务的教程吗?再次感谢
  • 我已经编辑了我的帖子。但是如果你有 choixe,我建议你使用带有 JSON 的 REST WebService
  • 好的,我现在离开办公室,明天会检查它,兄弟:)
猜你喜欢
  • 1970-01-01
  • 2023-03-06
  • 1970-01-01
  • 2018-01-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多