如何使用名称标签和我的arraylist解析选项标签作为这种类型
[[anyType{}],[Sandy,Mark,Tayler,Waine],[mark Henry]]
FetchFormResponse
{
FetchFormResult=anyType
{
Formlist=anyType
{
Form=anyType
{
Name=Form; Id=6; Options=anyType{};
};
Form=anyType
{
Name=Form1; Id=7;
Options=anyType
{
Option=anyType{Name=Sandy; Id=154; Type=TextBox; Value=anyType{};
};
Option=anyType
{
Name=Mark; Id=155; Type=TextBox; Value=anyType{};
};
Option=anyType
{
Name=Tayler; Id=156; Type=TextArea; Value=anyType{};
};
Option=anyType
{
Name=Waine; Id=157; Type=CheckBox; Value=Master,Graduate;
};
};
Form=anyType
{
Name=Form2; Id=9;
Options=anyType
{
Option=anyType
{
Name=Mark Henry; Id=185; Type=Checkbox; Value=anyType{};
};
};
};
};
};
};
}
知道是否有人解决了这个问题以及如何解决将非常酷。谢谢。
最佳答案
您必须创建肥皂对象并从那里获取响应,例如:
SoapObject response= (SoapObject) envelope.bodyIn;
SoapObject result= (SoapObject) response.getProperty(0);
SoapObject list= (SoapObject) result.getProperty(0);
SoapObject form= (SoapObject) list.getProperty(0);
SoapObject options= (SoapObject) form.getProperty("Options");
for(int i=0; i<options.getPropertyCount(); i++){
SoapObject option= (SoapObject) options.getProperty(i);
String name = option.getPropertyAsString("Name");
array.add(name);
}
这应该工作