How to post values to webservice in android

前端 未结 4 1761
一向
一向 2021-02-06 19:00

I want to get some clues about posting the values to the webservice...

When i post the values, i get the response in xml that has to be parsed. Any tutorials of posting

4条回答
  •  深忆病人
    2021-02-06 19:33

    Here is a useful tutorial on interacting with a REST service: http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/. If the service is a SOAP service, then take a look at the Stack Overflow question How to call web service with Android.

    As far as XML parsing, I wrote an Android app for which I also needed to parse XML. For my purpose I found that the XmlPullParser API was the most convenient: How to use XmlPullParser in Android

    One thing to note is that the Android 3.x and earlier implementation of XmlPullParser (from the Apache Harmony project) does not support getPrefix() or getAttributePrefix(int index). Beginning with Android 4.0, the XmlPullParser implementation switched to kXML2. I am not sure whether kXML2 supports the getPrefix() and getAttributePrefix(int) methods.

提交回复
热议问题