Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

I have implemented such a thing before. I followed a different approach.

First, I suggest you insert a sort of delimiter like "#" to separate each individual item of your ArrayList. You can refer this for that.

That will help you return a Array of String in the form "item1#item2#item3#"

Now as far as the Android code using ksoap is concerned, have a look at this

In this code, check the soap calling method. I separate the String returned by my webservice using the "#" delimiter and store it in an array for populating a Spinner.

You can do as per what you want.

Hope I helped you.

Cheers

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top