Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send ArrayList over the network - Convert Java ArrayList to XML String

I'm new to Java. I want to send an array (ArrayList) of objects over the network via Java Web Service to my Silverlight app. This ArrayList contains custom class objects:

ArrayList<SVNSearchResult> results

so I'm thinking the best way is to serialize this to an XML String and on the Silverlight part, use LinQ to parse it. If there's a better way to send it please let me know. Thanks.

like image 254
Alireza Noori Avatar asked May 31 '26 23:05

Alireza Noori


2 Answers

XML is a good fit for this. JSON would be one of the other usual suspects these days.

Whatever format you end up choosing, make sure you get the encoding right.

like image 167
Mat Avatar answered Jun 03 '26 13:06

Mat


For a starter, try JSON. It has a network-efficient format, and is supported by any major language in the world.

XML is only my second choice as it is more complicated to generate/parse and is more verbose.

like image 21
Vladimir Dyuzhev Avatar answered Jun 03 '26 11:06

Vladimir Dyuzhev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!