0 Replies Latest reply on Aug 14, 2013 5:08 AM by Mr.Oz

    Inconsistent typing with HTTP Data Service and <mx:HTTPService>

    Mr.Oz Level 1

      I am using an HTTP Data Service, which strongly types data returned as xml from Youtube API. I also have an HTTPService object <HTTPService>. Each entry in the raw XML data they retrieve contains several namespaces, like this:




            <gd:feedLink countHint="573986"/>



            <media:category label="Comedy" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Comedy</media:category>

            <media:player url="http://www.youtube.com/watch/>

            <media:thumbnail height="360" time="00:03:00"/>

            <media:title type="plain">Title</media:title>

            <yt:duration seconds="360"/>


          <gd:rating average="4.6989236" max="5" min="1" numRaters="940187" rel="http://schemas.google.com/g/2005#overall"/>

          <yt:statistics favoriteCount="959236" viewCount="199961940"/>



      The Data Service uses an XMLSerializationFilter, which converts the namespaces so that colons become underscores.  Flash Builder's Data/Service wizard created a data type for each entry and its nodes. A resulting data object looks like this:




      The HTTPService removes the namespaces so the same data looks like this:




      If I set the HTTPService serializationFilter property to XMLSerializationFilter it prefixes the data with the namespaces like the Data Service, but all entries will be of the ObjectProxy type, even when its resultElementType property is set to the Entry type. Extensive reading and experimenting have failed to solve this.


      Is there any way to change either the Data Service or HTTPService so that the results use the same type and the same naming scheme? Preferably strongly typed like the Data Service's use of the Entry type.