1

我一直在使用 KSOAP for Android 发送包含 6 个元素的 SOAP 请求,其中最后一个是一个值数组。这是代码...

       PropertyInfo properties[] = new PropertyInfo[numberOfProperties]; 
       properties[0] = new UserLogin("user2"); 
       properties[1] = new UserPassword("u2");
       properties[2] = new MAC_ID("00:01:02:03:04:05"); 
       properties[3] = new StartMeasurement(mStartTime);
       properties[4] = new StopMeasurement(mStopTime);

       SoapObject soapObjectRequest = new SoapObject(ROOT_NAMESPACE, mSoapMethodName);

       for(int i=0;i< properties.length;i++)
        soapObjectRequest.addProperty(properties[i]); 

       SoapObject eventList = new SoapObject(ROOT_NAMESPACE, "eventValues"); 

       SoapObject eventValues = new SoapObject(TYPE_NAMESPACE, "EventValues");

       eventValues.addProperty(9.9);

       eventValues.addProperty(101.1);

       eventList.addSoapObject(eventValues);

       soapObjectRequest.addSoapObject(eventList);

在请求中一切正常,禁止订购。当我调用 addSoapObject 时,它会将数组值首先放在正文请求中。因此 eventValues 元素内的所有内容都出现在请求的顶部。它应该是请求成功的最后一个元素。所有其他属性元素的顺序正确。

有什么方法可以规定 KSOAP 的顺序吗?我使用的是 2.6.0 版。

任何建议表示赞赏!

4

1 回答 1

0

如果你想在这里修复它是一个补丁和库 ksoap2-android-assembly-2.6.1--jar-with-dependencies.jar http://fbe.am/3k <---- 2个补丁和库

这是主题:http ://groups.google.com/group/ksoap2-android/browse_thread/thread/1ee05350dd8c041

非常感谢 Andrew O。这里也是他的带有修复的仓库(补丁是从他那里生成的)http://github.com/Usagimaru57/ksoap2-android

这个对我有用。

于 2012-01-14T09:26:12.903 回答