android - 复杂的 SOAP 请求

标签 android soap ksoap2 ksoap android-ksoap2

我的要求如下...

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
   <soapenv:Header/>
   <soapenv:Body>
      <Search>
         <specialties>
            <!--Zero or more repetitions:-->
            <arr:int>1</arr:int>
            <arr:int>2</arr:int>
            <arr:int>3</arr:int>
         </specialties>                      
         <gender>
            <!--Zero or more repetitions:-->
            <arr:string>male</arr:string>
            <arr:string>female</arr:string>
         </gender>            
      </Search>
   </soapenv:Body>
</soapenv:Envelope>

如何使用 Android Soap Request 传递相同的...

谢谢。

最佳答案

这样试试对你有帮助

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        SoapObject Search= new SoapObject(NAMESPACE, "Search");
        for(int i=0;i<mID.length & i<qty.length;i++){
            SoapObject Specialities=  new SoapObject("http://www.FoodTruck.zsl.com/", "Specialities");
            Specialities.addProperty("MenuItemID", mID[i]);
            Specialities.addProperty("Quantity",1);
            Specialities.addProperty("CartItems", CartItems);
        }
        request.addProperty("Search", Search);

关于android - 复杂的 SOAP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5229083/

相关文章:

java - ksoap2 v 任何其他前缀的前缀

android - android 中 SimpleDateFormat 的问题

java - 如何在 wsimport 中映射未知的复杂类型

java - 如何使用 Slf4j 的 Logback 实现通过 Spring 记录 SOAP 客户端消息

Java Web 服务客户端到 WCF Web 服务服务器。互操作性解决方案

android - 仅在 xmlns 属性上设置 KSOAP2 前缀

java - 如何编码 Activity 页面... android

android - ionic 2错误中的本地存储

android改变countDownTimer的时间

android - Android 上的 SOAP Web 服务