Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-22173

Xml response incorrectly parsing ArrayCollections.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Later
    • Adobe Flex SDK Previous
    • None
    • RPC: HTTPService
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Expose the attached "product.xml" file as a response to a http request (you can use the attached project, it loads the file from filesystem but the result is the same).
      2. Check the "images" property of the generated ObjectProxy. It should be an array (contains only children of the same type), but it's a wrapper and the real array is in the nested property with the name of any children.
      3. If you try to map the xml to an object with a "images" attribute of type ArrayCollection, you'll notice that the real array is put in the first element of the "images" ArrayCollection (that would have only one element anyway).

      Actual Results:
      result.images.productImage is ArrayCollection
      "images" is an ObjectProxy containing a property with the name of the first object, that contains the real ArrayCollection.
      It seems that sometimes everything works correctly, but in the attached case the error is always reproduced.

      Expected Results:
      result.images is ArrayCollection
      Either an xml element containing a list of same type children is mapped directly as ArrayCollection, or there should be a way to force/declare this.

      Workaround (if any):
      As in the code attached, you can test the type of the proxied array and act accordingly. For every array received.

      As a side note, I have to say that the same behaviour (the real array inserted in the first element) happened a few time even with SOAP calls, but unfortunately at the moment I can't get a simple example that has always this behaviour.

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: