1 Reply Latest reply on Dec 3, 2009 1:57 PM by wolfman33

    When to use XMLListCollection vs. ArrayCollection for HttpService Result

    rwevans23

      Hi All,

       

      I am having difficulty with a basic and important concept and that is when to use an XMLListCollection or an ArrayCollection for HttpService result. In most examples I have run across the data returned from a HttpService is in the form of XML. The examples are usually of this format

       

      <data>

           <stuff>

                <attribute1>xxx</attribute1>

                <attribute2>xxx</attribute2>

                <attribute3>xxx</attribute3>

           </stuff>

           <stuff>

                <attribute1>xxx</attribute1>

                <attribute2>xxx</attribute2>

                <attribute3>xxx</attribute3>

           </stuff>

           <stuff>

                <attribute1>xxx</attribute1>

                <attribute2>xxx</attribute2>

                <attribute3>xxx</attribute3>

           </stuff>

      </data>

       

      In some examples this returned data is written directly to an ArrayCollection. However I see many posts where people are having difficulty with what looks like similarly formatted XML correctly populating their ArrayCollection. The most common answer given in these posts is "Why don't you just use an XMLListCollection?" Which seems to work and the person goes away happy. But I am confused?? Why does this work? Or better question is why doesn't the ArrayCollection work? It seems like much of the time XML data is returned in these type of HttpRequests so when should you use an ArrayCollection??

       

      Anyway if someone could perhaps shed some light on this subject I would appreciate it.

       

      thanks,

       

      --Russ