Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Adobe Flex SDK 4.0 (Release)
-
None
-
None
-
Affected OS(s): Windows
Affected OS(s): Windows XP
Browser: Firefox 3.x
Language Found: English
Description
Steps to reproduce:
1. Create web service with a WSDL file including the following definition:
<xsd:complexType name="Parent">
<xsd:sequence>
<xsd:element name="children" type="Child"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Child">
<xsd:attribute name="ID" type="String"/>
</xsd:complexType>
2. Generate web service code and import
3. Call web service and try to get a Parent object with one or more "Child" elements
Actual Results:
null array
Expected Results:
decoded Child elements into an ArrayCollection
Workaround (if any):
XMLDecoder does not seem to work well with only one sequence element. The workaround is to add another element in xsd:sequence, as shown below:
<xsd:complexType name="Parent">
<xsd:sequence>
<xsd:element name="children" type="Child"/>
<xsd:element name="dummyChildren" type="Child"/>
</xsd:sequence>
</xsd:complexType>
The problem in the code seems to be related to XMLDecoder, line 1079-1090:
if (hasSiblings)
else
{
// If this is a "wrapped array", the iterable value should be assigned
// as the value of the parent itself. However, we only replace
// the parent if it hasn't been created already. (It could be
// created if the parent QName has a registered collectionClass
// in the SchemaTypeRegistry - see bug FB-11399).
if (!(parent is ContentProxy && parent.object_proxy::content != undefined))
When there is only one sequence element defined, the else branch is taken and the check in the if statement fails (in my case parent was a ContentProxy). Adding a new sequence element in the definition made XMLDecoder take the first if statement and skip the issue altogether. This is not ideal though