2 Replies Latest reply on May 24, 2010 6:15 AM by emerson_rm

    Problem to convert HTTPService Result to ArrayCollection

    emerson_rm

      Good morning,

       

      I have been working with flex since February in a project of my company in Brazil.

      Yesterday I got a problem to convert a HTTPService result to ArrayCollection.

       

      My result contains a field (String) called CFOP whose format is X.XXX, e.g. 5.001, 4.015, 7.010, and others.

       

      My class on server side or my field in the DB are both String / varchar.

       

      The XML result is:

       

      <?xml version="1.0" encoding="UTF-8" ?>

      <output>

            <dados>

                  <id>7.000</id>

                  <valor>ADMISSÃO TEMPORARIA</valor>

            </dados>

            <dados>

                  <id>5.010</id>

                  <valor>ENTREPOSTO DE ARMAZENAGEM</valor>

            </dados>

            <dados>

                  <id>3.210</id>

                  <valor>TRANSFERENCIA DE SIMPLES REMESSA</valor>

            </dados>

      </output>

       

      ...

       

      When I try to convert this result to ArrayCollection using:

       

      array = new ArrayCollection([httpservice.result.output.dados]);

       

      my collection changes the value of ID Tag, for this:

       

      [id=7, valor=ADMISSÃO TEMPORARIA],

      [id=5.01, valor=ENTREPOSTO DE ARMAZENAGEM],

      [id=3.21, valor=TRANSFERENCIA DE SIMPLES REMESSA]

       

       

      The convertion assumes that field ID is a double or float data type.

       

      How can I keep the original value for ID in my ArrayCollection?

       

      Tks.

       

      Emerson RM.