How to post values to webservice in android

前端 未结 4 1756
一向
一向 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:15

    Below Link can be of Help.

    Accessing Webervice with Parameters

    0 讨论(0)
  • 2021-02-06 19:18

    Looks like this question is pretty old, but I thought I would add this for anyone else that comes along.

    The lukencode.com provided above works, but it runs on the main thread and blocks, so it can cause the dreaded "Application Not Responding" error from Android. There is a similar solution available that breaks it out onto it's own thread so it can run asynchronously without blocking here.

    Rest service wrapper

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-02-06 19:40

    http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/

    The above link provides a good example of a class you can use to call a REST webservice, both with and without parameters.

    0 讨论(0)
提交回复
热议问题