当前位置:编程学习 > wap >>

Android调用.net写的webservice

碰到一个调用webservice的问题,希望高手指点:
用Ksoap调用.net写的webservice时,需要post数据给webservice
但是数据格式里面不是单一的数据组合,而是有包含二维的数据格式。不知道要怎么构造这个数据传递给服务器:
需要传的数据参数如下:
 <soap:Body>
    <HouseRegirsterMobile xmlns="http://tempuri.org/">
      <houseAddress>string</houseAddress>
      <houseOwner>string</houseOwner>
      <houseOwnerIdCard>string</houseOwnerIdCard>
      <houserOwnerTel>string</houserOwnerTel>
      <rentPersonName>string</rentPersonName>
      <rentPersonIdCard>string</rentPersonIdCard>
      <rentPersonTel>string</rentPersonTel>
      <rentStartDate>dateTime</rentStartDate>
      <rentEndDate>dateTime</rentEndDate>
      <livingPersonList>
        <LivingPerson>
          <LivingPersonName>string</LivingPersonName>
          <LivingPersonIdCard>string</LivingPersonIdCard>
          <LivingPersonTel>string</LivingPersonTel>
        </LivingPerson>
        <LivingPerson>
          <LivingPersonName>string</LivingPersonName>
          <LivingPersonIdCard>string</LivingPersonIdCard>
          <LivingPersonTel>string</LivingPersonTel>
        </LivingPerson>
      </livingPersonList>
    </HouseRegirsterMobile>
  </soap:Body>

请问这段数据要怎么构造:
   <livingPersonList>
        <LivingPerson>
          <LivingPersonName>string</LivingPersonName>
          <LivingPersonIdCard>string</LivingPersonIdCard>
          <LivingPersonTel>string</LivingPersonTel>
        </LivingPerson>
        <LivingPerson>
          <LivingPersonName>string</LivingPersonName>
          <LivingPersonIdCard>string</LivingPersonIdCard>
          <LivingPersonTel>string</LivingPersonTel>
        </LivingPerson>
      </livingPersonList>
其他的可以直接用
        SoapObject rpc = new SoapObject(nameSpace, methodName);
//参数
rpc.addProperty("houseAddress", "dddd");
方法构造。
但是不知道livingPersonList 这组数据怎么构造:
请高手指点一下,谢谢!
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,