How data is parsed or obtained (Soapobject parsing) after it is connected via webservice

Source: Internet
Author: User

============ 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.