Adobe Flex

Passing ArrayCollections between .NET and Flex

When using the Weborb communication server from MidnightCoders there is a shortcoming in regards to supporting serverside deserialization of ArrayCollections. It supports Arrays but when trying to send complex types containing a reference to a ArrayCollection it is necessary to add a classmapping manually.

If one tries to pass an ArrayCollection to the server it will throw an error and the client will handle it without explaining exactly what went wrong. Recieving lists and collections and have them deserialized on the client into an ArrayCollection is no problem, its just the other way around that is more complex.

You need to map the flex.messaging.io.ArrayCollection (ClientClass) to the omnipresent Weborb.Util.ObjectProxy (ServerClass).
This can be done wither through the management console (Typically the default webpage of the server) or via the weborb.config residing in the “bin” directory of the server.

Why they have ommitted this classmapping from the default configuration beats me, but the operation is very simple, so it should not pose a significant problem once acknowledged.

Advertisements

3 thoughts on “Passing ArrayCollections between .NET and Flex

  1. Thanks for the post! We will update the default settings to make ArrayCollection serialization transparent.Cheers,Mark

  2. Sounds good, Mark… Im happy to be able to be of assistance. I will hence attempt to be extrovert from now about all my findings.Cheers,Peter

  3. This post is actually the freshest on this important topic. I absolutely feel the same way with your points of view and will hungrily look forward to your future updates. Just saying thanks will not just be sufficient, for the extraordinary clarity in your writing. I will instantly grab your rss feed to stay up to date of any updates. Impressive work and much success in your blogging endeavors!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s