Android platform invoke WebService detailed

Source: Internet
Author: User
Tags soap wsdl

The previous article has introduced the Web service and its related knowledge (Android development WebService), I believe some friends have patience to try to call the Web service in the Android application. This article explains and demonstrates the development of Web service for the Android platform through a simple example.

Ksoap2-android Introduction

Invoking Web service on the Android platform relies on Third-party class library ksoap2, a SOAP WEB service client development package that is used primarily for resource-constrained Java environments such as applets or J2ME applications (cldc/cdc/ MIDP). Carefully read the introduction of KSOAP2 you will find that it is not mentioned in the Android platform development, yes, on the Android platform we do not use the KSOAP2 directly, but the use of KSOAP2 Android. KSoap2 Android is an efficient, lightweight soap development package on the Android platform, equivalent to the KSOAP2 porting version on the Android platform.

ksoap2-android jar Pack Download

Ksoap2 Android currently has the latest version of 2.5.4, named Ksoap2-android-assembly-2.5.4-jar-with-dependencies.jar, whose download address is: http:// Code.google.com/p/ksoap2-android/, after entering the page, click on the "Downloads" tab, as shown in the following image:

Below the "Downloads" page, find the purple link shown in the following figure, then right-click on the link and find the relevant download to download. The download items displayed in the right menu vary according to the browser, such as the 360 browsers I use, right-click on the key, and choose "Download using 360 secure browser" to pop up the download Save dialog box.

Android platform invoke Web service sample

Here is an example of how to invoke Web Service on the Android platform. Now that you want to invoke the Web service, you must have a Web service. We chose to use the Web service, which was used in the previous article, to query the place where the cell phone number belongs, and its WSDL is http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.