Flex 3.0 Introspecting Utility: Handling Collections Bug

By M&S Consulting (Ashwin - Available in January) on Jun 8th, 2009
Filed Under Technical Tips // Tags: , ,

Even Flex Builder with all its awesomeness is not without its own set of quirks. It seems the introspecting utility does not handle collections(arrays, arraylist, string[]) properly.

My Example Problem and Solution

Following is a simple example:

  • I had written a java webservice that takes a Array of a custom object and loads it to the database.
  • I tested the webservice by itself and it worked.
  • I used the Flex Builder’s Introspecting utility to integrate my Flex Application with my webservice.
  • I had added the client side code to invoke the webservice with the appropriate data and tested it.
  • It failed miserably.

The problem was with the objects that Flex sent to the webservice. After long hours of debugging, I noticed that the objects I had received in my service, even though a collection, were serialized in a format Java was unable to understand. They were objects, but i was unable to cast or convert them.

I decided to modify my Java webservice to accept a String[], as I assumed my problem was with a collection of objects. I modified my client application to convert all the data in the model to a colon-delimited-string and passed a String[] to my webservice.

This is when the real problem showed itself; I noticed that in my webservice all strings in the arrays were concatenated into one huge ‘comma-delimited-string’. After realizing what the introspecting utility was doing to the String[], I just had to make some minor modifications to the webservice to get it to work.

Conclusion

There is still a problem with Arrays of Custom Objects. Please check the ‘Adobe Bug Database’ to see related bugs. For now, the only work around as i see it would be to use BlazeDS for your webservice integration. It is a middle-layer for your environment, it externalizes the webservice connections, and has a better messaging framework as well as more feature. I feel it is a good choice, even if Adobe does fix this issue.

Bookmark and Share

Related Information:

  1. Dynamic forms and dependent dropdowns in Flex I had the age-old requirement today to build a data-driven, dynamic form…only this time with my RIA written in Adobe...
  2. Modular Flex Development - Multiple SWFs I have been tasked with coming up with a modularized approach for logically separating out an extensive Flex application I...
  3. BlazeDS: Introduction and Installation BlazeDS is a java-based remoting and messaging technology that allows web-clients to connect to back-end distributed data easily. BlazeDS creates...
  4. Applications with SQL Maintained Outside of Stored Procedures I have seen multiple custom solutions and packaged applications store their SQL outside of stored procedures. I am focusing this...
  5. BPA 10.1.3.4 Windows Install with XE I have just had a heck of a time with installing BPA (Architect) Evaluation on a Windows Server 2003 machine....

Leave a Reply


Archives

Recent Comments

  • Dave Bull said: At last! a tutorial which explains everything! And you make it look so easy as well :) Very well doen...
  • Paul Guidry said: Great tutotial, but at the end I had to log into apex using sys and not system. I recieved the same...
  • Unreal said: Metalink is so bad. To think Oracle is proud of this? Totally unusable.
  • Amy said: I was wondering if you implemented the google CSE on an apex application? I am trying to do this for a...
  • Sanjay J. Khachane said: Dear all, This is Code For Refresh Materialized in .NET Public Sub RefreshMView() Dim tran...

Calendar

February 2010
M T W T F S S
« Jan    
1234567
891011121314
15161718192021
22232425262728

Featured Testimonial

"M&S has taken 'partnership' to a new level. They are not only a deeply skilled service provider, the M&S team is actually a mission critical component to our operations, taking on new initiatives as well as maintaining custom, open source, and COTS solutions."

CEO, MedPivot

Free SQL Service