Friday, 15 January 2010

android - How to process an array returned by a wsdl? -



android - How to process an array returned by a wsdl? -

i using ksoap2 in order extract array of strings wsdl based webservice(for android app). how process returned array? need 3-4 lines of code allow me save , utilize returned array in class. thanks.

string r = namearray.columncount("userid", limitstart, loadnumber,loggername); string temp = r.replaceall(";\\s", ",").replaceall("string=", " ") .replace("anytype{", "").replace(",}", ""); string[] fulname = temp.split(",\\s+");

'namearray.columncount' function gets array wsdl(don't confused in that)

step 1- here getting array values returned wsdl in string called 'r'.in case getting array of numbers returned array string r looks this

r ="anytype{string=10054; string=10055; string=10056; string=10035; string=10052; string=10036; string=10037; string=10038; }"

step 2- creating string variable called temp removing unwanted characters using replaceall function. after removing unwanted characters temp looks this

temp="10054, 10055, 10056, 10035, 10052, 10036, 10037, 10038"

step3- created string array called 'fulname' , split modified string ',\s' array fulname after split looks this

fulname = [ 10054, 10055, 10056, 10035, 10052, 10036, 10037, 10038]

this work fine because wsdl array homecoming same type of string same unwanted characters

hope understood luck

android wsdl ksoap2

No comments:

Post a Comment