0 Replies Latest reply on Dec 2, 2011 12:40 AM by DushyantG

    Value objects not mapped properly in autogenerated proxy code built by flex builder.

    DushyantG

      I have added a soap based web service to my flex project and using flex builder 4 I have generated the proxy code. The webservice response is:

       

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

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

           <soap:Body>

                <InitializeAppResponse xmlns="http://xml.abc.com/ns/hkjava/myProj">

                     <GType>G1</Gtype>

                     <GType>G2</Gtype>

                     <GType>G3</Gtype>

                     <GType>G4</Gtype>

                     <Dept>

                               <DeptId>1</DeptId>

                               <DeptName>Engg</DeptName>

                     </Dept>

                     <Dept>

                               <DeptId>2</DeptId>

                               <DeptName>Humanities</DeptName>

                     </Dept>

                     <Dept>

                               <DeptId>3</DeptId>

                               <DeptName>Arts</DeptName>

                     </Dept>

                     <City>

                               <CityId>1</CityId>

                               <CityName>Mumbai</CityName>

                     </City>

                     <City>

                               <CityId>2</CityId>

                               <CityName>Montreal</CityName>

                     </City>

                     <City>

                               <CityId>3</CityId>

                               <CityName>New York</CityName>

                     </City>

                </InitializeAppResponse>

           </soap:Body>

      </soap:Envelope>

                             

      Now the data members in classes generated by the flex builder are:

       

      public class _Super_InitializeAppResponse extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject{

           private var _internal_GType : ArrayCollection;

           private var _internal_ Dept: ArrayCollection;

           model_internal var _internal_Dept_leaf:valueObjects.Dept;

           private var _internal_ City: ArrayCollection;

           model_internal var _internal_City_leaf:valueObjects.City;

       

      }

       

       

      public class _Super_Dept extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject{

           private var _internal_DeptId : Number;

           private var _internal_DeptName : String; 

      }

       

       

      public class _Super_City extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject{

           private var _internal_CityId : Number;

           private var _internal_CityName : String; 

      }

       

      FB has also created InitializeAppResponse, Dept, and City classes which extend _Super_InitializeAppResponse, _Super_Dept, and _Super_City respectively.

       

      When I use event:ResultEvent to fetch event.result in the result handler of the webservice that I have described, I can see that event.result is of type InitializeAppResponse and also see that is has its members populated.

       

      But the strange thing happening is that the Dept ArrayCollection in this InitializeAppResponse object contains objects of type City and not of type Dept.

      And so the data in these objects is not proper. eg. when i try to examine this Dept type arraycollection through the flex debugger, the CityId shows NaN, and the CityName shows null.

       

      Plz help, I'm in the middle of an urgent project, both the UI and the webservice have been completed but I'm stuck because I cant properly access the data sent by the webservice.

       

      Thanks in advance.