views:

387

answers:

2

My web service is returning quite a bit of data, so i'm storing it in an arraylist and returning that to my application. I don't know whether or not this is the preferred method or not. When the arraylist is returned and displayed in my application, it also displays the arraylists "anyType" section. I'm new to this whole process so i'm sure i'm missing something somewhere or going about this incorrectly. Can anyone point me in the right direction please?

A: 

Are the instances of the object in the ArrayList all the same type? If so, then you might want to expose an IEnumerable<T> (where T is of that type) and then regenerate whatever proxies you are using on Android. This will probably give you a strongly-typed list which you can then consume more easily.

casperOne
Yes, it's returning all string values. Do you have a code snippet for that? If not i'm sure i can find and example on google. Also, do you know if there's anyway to separate each string value?
benjamin schultz
@benjamin schultz: You just return IEnumerable<string>, which List<string> implements. As for separating each string value, what do you mean?
casperOne
Sorry if it's confusing! Basically, I have a VB .net ws which calls upon a stored procedure that retrieves string values from my database (string values such as all the states within a country). I loop through and get all the states and store them in an arraylist (i've also been testing substituting arraylist for just a list of strings). Then I return that arra list to my application, and from there i want to bind that to a ListView. ...continuing post on different comment...
benjamin schultz
I can get so far as to returning my arraylist to my application but when it gets there it contains all the unnecessary anyType{ junk, and i don't recognize that as something i can parse. Would i be better off trying to find another way to do all of this? /long winded explanation Thanks again man for all your help!
benjamin schultz
A: 

I was messing with similar issue for quite a while and after long hours of debugging, I solved it and decided to publish a tutorial on ksoap and .NET . Hope it helps.

DFDF