Why Flex 3 Might Kill Your Web Services Powered Application

Do you have a Flex 2 or Flex 3 Beta 2 application with a SOAP based web services backend? If so, you might want to consider holding off upgrading to Flex 3 Beta 3 or the final version of Flex 3 (when it’s released).

If you do upgrade, you may notice that attributes on objects received in web service responses are not always present.

As a real world example, we were expecting to receive an object such as:

(Object)#0
isActive = false
id = 14
name = Salon7

Our server logs (and manual calling of the web service) showed that all the attributes were being sent, however, in Flex the object was received as:

(Object)#0
isActive = false

Obviously it’s not very helpful when two thirds of your object attributes go missing.

My colleague Jason filed bug #SDK-14194 over at the Flex bug tracker, and after some discussion it turns out that the way Flex handles certain SOAP elements changed between beta 2 and beta 3. Prior to beta 3, xsd:all elements (typically used in structuring complex objects, particularly those encoded by Ruby on Rails’ ActionWebService/SOAP4R), allowed child elements to appear in any order (as is valid according to the specs). However, Flex now erroneously treats xsd:all elements as xsd:sequence elements, requiring the child elements to arrive in the same sequence as they are specified in the WSDL file.

The current workaround is to ensure that you specify the element as an xsd:sequence and/or ensure that child elements arrive in the predefined order, but for those of you using third party web services or those backed by libraries/frameworks such as SOAP4R and Rails’ ActionWebService this might not be possible.

Unfortunately Svetlin Kalaydjiev of Adobe has stated that this bug won’t be fixed in time for the final Flex 3 release, but that it may be fixed some time after Flex is open sourced. I have filed enhancement request #SDK-14321 to request support for the xsd:all tag. If you are experiencing this problem it may be helpful if you provide Adobe with some input regarding your experiences.

For those of you using Rails’ ActionWebService, we have made some progress on a patch which ensures that xsd:all child elements arrive in the same order each time and will keep you posted if we produce a releasable patch.

AddThis Social Bookmark Button

3 Comments »

  1. delirial said,

    January 14, 2008 @ 12:52 am

    Nice find, mate.

    Stuff like this makes me wonder where the hell is the QA department in companies like this one.

    They should implement according to the spec if they want developers to embrace their platform.

    Reminds me of some of my co-workers. As soon as I try something “odd” on their application, they go like: “the user is not supposed to do that”. I reply with: “yeah, but the user might…”.

  2. David Bates said,

    January 16, 2008 @ 3:57 pm

    The Web Services code in Flex is having a complete overhall in Flex 3. I worked on my last project with Flex 2 and different HotFixes as well as each of the Flex 3 betas. The behaviour of web services changed with each iteration. Adobe, I love you, but get this sorted!

  3. SOG knives said,

    July 17, 2008 @ 8:11 pm

    SOG knives…

    Interesting ideas… I wonder how the Hollywood media would portray this?…

RSS feed for comments on this post · TrackBack URI

Leave a Comment