如何发布值的android到web服务android、web

2023-09-05 01:33:03 作者:旧城等旧人

我想获得张贴值到web服务的一些端倪......

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

当我张贴的价值观,我得到的已经被解析的XML响应。张贴值web服务的任何教程将有很大的帮助......

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

推荐答案

下面是一个REST服务交互的实用教程:的http://luken$c$c.com/2010/04/27/calling-web-services-in-android-using-httpclient/.如果该服务是一个SOAP服务,然后看看堆栈溢出问题如何调用Web服务与Android 。

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.

至于XML解析,我写了一个Android应用程序,对此我也需要解析XML。对于我的目的,我发现 XmlPullParser API是最方便的:的如何使用XmlPullParser在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

有一点需要注意的是,在Android 3.x和早期实施 XmlPullParser (来自Apache Harmony项目)不支持的 获取preFIX()的getAttribute preFIX(INT指数) 。与Android 4.0开始, XmlPullParser 执行切换到 kXML2 。我不知道kXML2是否支持获取preFIX()的getAttribute preFIX(INT)的方法。

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.