ksoap2 result parsing

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

ksoap2 result parsing

Postby Kevin.A » Mon Jan 11, 2010 8:20 pm

Hello, i'm trying to get results from a python soap server that returns a dict of dicts...

this
Code: Select all
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
        String result= resultsRequestSOAP.getProperty("Result").toString();

returns
Code: Select all
_x0032_967=anyType{cmd=TMSG; id=2967; cmdTxt=This is one of the messages; timeupdated=2010-01-11 13:51:35; }; _x0032_969=anyType{cmd=TMSG; id=2969; cmdTxt=This is one of the messages; timeupdated=2010-01-11 13:51:38; }; _x0032_968=anyType{cmd=TMSG; id=2968; cmdTxt=This is one of the messages; timeupdated=2010-01-11 13:51:37; };


i need to parse it into a hash table, so i can deal with each message.

Can someone help me?

Thanks
Kevin A
Kevin.A
Freshman
Freshman
 
Posts: 7
Joined: Sun Dec 06, 2009 6:58 am

Top

Postby Droid123 » Tue Jan 12, 2010 12:27 am

You could either extract the data you need from the SoapObject, which is easy to do, but will result in ugly code.

Or you could build classes that implement KvmSerializable for each complex type-tag in the XML response, to map the response to, which is a pain to accomplish if you've never done so before, but works really well íf it works.

Let me know if you want to try the latter, i'll give you a hand. If so, please post the structure of the XML that you're trying to parse (or WSDL).


On a side-note, did anyone manage to send a complex type object as a property in the bodyout with the kSoap2 library? please let me know, i'm having some issues with it.
Droid123
Experienced Developer
Experienced Developer
 
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm

Issue in parsing ksoap2 response

Postby novicespace » Wed Jan 20, 2010 11:29 pm

I'm getting the same error message .. any guidance would be appericated
novicespace
Freshman
Freshman
 
Posts: 2
Joined: Wed Jan 20, 2010 11:25 pm

Re: Issue in parsing ksoap2 response

Postby Droid123 » Thu Jan 21, 2010 10:34 am

novicespace wrote:I'm getting the same error message .. any guidance would be appericated


whats the issue and could you post your code?
Droid123
Experienced Developer
Experienced Developer
 
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 7 guests