Android中 调用WebService详解 ksoap2-android

本文详细介绍了如何在Android项目中使用ksoap2-android库调用WebService。首先,从指定链接下载jar包并放入项目的libs目录,然后将其添加到Build Path。在布局文件activity_main.xml中进行相应配置。在实际调用WebService时,部分情况下的soapAction可以设置为null。
摘要由CSDN通过智能技术生成

首先下载ksoap2-android jar包,下载地址为:https://code.google.com/p/ksoap2-android/

在项目下面建立一个libs文件夹,将刚刚下载的jar包放进去,再将其加入到工程的Build Path中



1. 布局文件/res/layout/activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center_horizontal"
    android:orientation="vertical" 
    android:layout_margin="0px"
    android:padding="0px">
    <TextView
         
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp"
        android:text="用户登录"
        android:textColor="#3f8f3f"
        android:textSize="30sp"/>

    <TableLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="80dp"
        android:stretchColumns="0,3" >

        <TableRow
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:gravity="center" >

            <TextView />

            <TextView
                android:layout_width="80dp"
                android:layout_height="wrap_content"
                android:gravity="left|center_vertical"
                android:text="用户名:"
                android:textColor=&#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值