我如何在android中解析这种类型的web服务?请看下面的图片。我在.net中创建了这个web服务,现在我想解析并使用Android中的Login webservice。请任何人帮助它将非常感激。感谢
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>
答案 0 :(得分:1)
它&#34; KSOAP webService&#34;,他们有很多教程。
http://karanbalkar.com/2014/03/tutorial-78-using-ksoap2-in-android/
登录webservice的例子 https://github.com/thira/blog-demos/tree/master/android-kSOAP2-example
http://programmerguru.com/android-tutorial/how-to-call-java-web-service-in-android/