1 Reply Latest reply on Aug 4, 2008 6:00 PM by Gregory Lafrance

    Problem of Decoding XML into Strongly Typed Objects

    odixp
      Webservice response:

      <soap:Envelope xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <ns2:findMenuByAccountIdResponse xmlns:ns2=" http://service.platform.nhncorp.com/">
      <menu>
      <code>001</code>
      <id>1</id>
      <name>System</name>
      <ns2:children>
      <ns2:menu>
      <code>001001</code>
      <id>2</id>
      <name>Organization</name>
      <leaf>true</leaf>
      <level>2</level>
      <parentId>1</parentId>
      </ns2:menu>
      </ns2:children>
      <leaf>false</leaf>
      <level>1</level>
      <parentId>0</parentId>
      </menu>
      </ns2:findMenuByAccountIdResponse>
      </soap:Body>
      </soap:Envelope>

      Menu.as:

      [Bindable]
      public class Menu extends AbstractNode
      {
      .......ignore other property
      public var children:ArrayCollection;
      }


      Decode XML from a Web Service into Strongly Typed Objects:

      qname = new QName(" http://service.platform.nhncorp.com/", "menu");
      SchemaTypeRegistry.getInstance().registerClass(qname, Menu);
      qname = new QName(" http://service.platform.nhncorp.com/", "children");
      SchemaTypeRegistry.getInstance().registerCollectionClass(qname, ArrayCollection);

      the problem is that the children is always null.
      how to get the children object?