我希望有人可以帮助我,因为这个问题需要很多时间而且我不知道解决方案。thx 提前很多......我尝试调用我的 AXIS2-Webservice,它返回一个像这样的对象:
public class TestObject{
private int zahl = 1;
private String name = "test";
SecondObject sec_object = new SecondObject("eins");
List <SecondObject> obj_list = new ArrayList<SecondObject>();
static SecondObject [] array;
public TestObject(){
obj_list.add(new SecondObject("zwei"));
obj_list.add(new SecondObject("drei"));
array = obj_list.toArray(new SecondObject[2]); }
//getter & setter
public class SecondObject {
private String wert;
public SecondObject(String wert) {
this.wert = wert;
}
在 Android 中,我将其称为:
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject) envelope.getResponse();
int count = response.getPropertyCount();
Log.v(TAG, "count :"+count);
for (int y = 0; y < count; y++){
if (response.getProperty(y)instanceof SoapObject){
SoapObject sobj = (SoapObject) response.getProperty(y);
Log.v(TAG, "soapOBJ "+sobj);
Log.v(TAG, "count "+sobj.getPropertyCount());
if (sobj.getProperty(0)!= null){
Log.v(TAG, "!=NULL"+sobj.getProperty(0)+"");
}
}
}
SoapObject array = (SoapObject) response.getProperty("array");
Log.v(TAG, "array "+array);
我看到很多帖子,它们只调用一个对象数组。在这种情况下,我想调用一个包含对象数组的对象...问题是:数组仅包含一个元素,请参阅此日志:
09-05 14:58:31.120: V/ASYNCTASK(9314): count :7
09-05 14:58:31.120: V/ASYNCTASK(9314): soapOBJ SecondObject{wert=zwei; }
09-05 14:58:31.120: V/ASYNCTASK(9314): count 1
09-05 14:58:31.120: V/ASYNCTASK(9314): !=NULLzwei
09-05 14:58:31.120: V/ASYNCTASK(9314): soapOBJ SecondObject{wert=drei; }
09-05 14:58:31.120: V/ASYNCTASK(9314): count 1
09-05 14:58:31.120: V/ASYNCTASK(9314): !=NULLdrei
09-05 14:58:31.120: V/ASYNCTASK(9314): soapOBJ SecondObject{wert=zwei; }
09-05 14:58:31.120: V/ASYNCTASK(9314): count 1
09-05 14:58:31.120: V/ASYNCTASK(9314): !=NULLzwei
09-05 14:58:31.120: V/ASYNCTASK(9314): soapOBJ SecondObject{wert=drei; }
09-05 14:58:31.120: V/ASYNCTASK(9314): count 1
09-05 14:58:31.120: V/ASYNCTASK(9314): !=NULLdrei
09-05 14:58:31.120: V/ASYNCTASK(9314): soapOBJ SecondObject{wert=eins; }
09-05 14:58:31.120: V/ASYNCTASK(9314): count 1
09-05 14:58:31.120: V/ASYNCTASK(9314): !=NULLeins
09-05 14:58:31.120: V/ASYNCTASK(9314): array SecondObject{wert=zwei; }