============ Problem Description ============
It took a few days to finally connect to the database, but the new problem appeared again! The data obtained contains the anytype,string type.
How do I parse it out? You guys help!
============ Solution 1============
public static centerinfo[] Getworkon (Soapobject obj) {
centerinfo[] info = null;
try{
if (Obj.getpropertycount () > 1) {//have center information
int len = Obj.getpropertycount ()-1;
info = new Centerinfo[len];
for (int i = 0;i < len;i++) {
Soapobject child = (soapobject) obj.getproperty (i + 1);
String idstr = child.getpropertyasstring (0);
String content = child.getpropertyasstring (1);
String sender = child.getpropertyasstring (2);
String typestr = child.getpropertyasstring (3);
String uId = child.getpropertyasstring (4);
String time = child.getpropertyasstring (5);//Times
Long id = long.parselong (IDSTR);
int type = Integer.parseint (TYPESTR);
Info[i] = new Centerinfo (id,content,sender,type,uid,time);
}
}
}catch (Exception e) {
E.printstacktrace ();
}
return info;
}
============ Solution 2============
It's the object you get, and what you get is what you parse. Do you get the soapobject to be converted into other types and then parse with JSON???
============ Solution 3============
It depends on how the Http://192.168.1.195:88/service1.asmx this webservice defines the return data.
How data is parsed or obtained (Soapobject parsing) after it is connected via webservice