Hi everybody !
I have a strange problem with SOAP deserialization in flex 3.2, and I thought this forum will be the best place to get answers ...
When I try to fetch some objects (like the ones shown below), the XMLDecoder does not deserialize all the properties.
In this case, it stops at the property named "rating". After it, all other data are lost.
I've used the flex builder debugger to locate the problem, and this lead me to the following method in the XMLDecoder class :
getApplicableValues(parent:*, valueElements:XMLList, name:QName,context:DecodingContext, maxOccurs:uint):XMLList:
State of the variables, before the "bug" :
The strange behavior appears after the five first properties had been deserialized correctly.
At this step : startIndex = 5, and the next property to unmarshall is "user" (according to the MExpertNotes object mapping)
the valueElement's list contains the following elements :
to simplify the notation, I will write only the position in the list and the xml tag name (see the complete soap response for more details at the end of this post)
(position, fieldName)
(0, ID) -> inherited from MotocycletteObjectImpl
(1,comment)
(2, noteValidation) (a Bean, never returned by our service -> set to null)
(3,noteValidationID)
(4,rating)
(5,timeOfCreation) -> inherited from MotocycletteObjectImpl
(6,user) (a Bean, never returned by our service -> set to null)
(7,userExpert) (a Bean, never returned by our service -> set to null)
(8,userExpertID)
(9,userID)
(10,version) -> inherited from MotocycletteObjectImpl
when it enters the for loop, at the first iteration the valueElements
.name is equals to "timeOfCreation" and the name parameter is equal to "user".
so this test : if (name == null || valueElements.name() == name
|| ((name.uri == "" || name.uri == null)
&& name.localName == valueElements.name().localName))
returns false. The skipAhead variable is set to false (and i don't understand why). It stops iterating over the valueElementList, and so, skips all other properties.
Is this a bug ? Does a workaround exists ?
This affects many of our objects.
Any help would be greatly appreciated.
Best regards,
Jules Pajot
R&D engineer for Mikros Image
www.mikrosimage.fr
[EDIT] : My Message was too long, so I put the complete message here :
http://docs.google.com/View?docid=dd6j35ft_38grb9c7cr
PS : I apologize for my english wich is far from perfect :)
As a reminder , the XMLDecoder class method ( line 2204 ):