0 Replies Latest reply on Sep 19, 2007 8:01 AM by triviaguy

    Sending flex objects to a Web Service

    triviaguy
      I've got a web service that takes a complex object as input. It is a Document/Literal service, and I'm having problems with object's child collections. I'm currently having 3 issues with the service call:

      1) If my object contains an ArrayCollection of other objects, each item in the collection is wrapped by two sets of <item> tags, rather than one.

      2) The <item> has no specified type.

      3) The child objects seem to be serialized differently than the parent object - Dates in the XML are formatted differently even though both objects have Date types.

      To illustrate the issues, the following is a fragment of the XML that ActionScript is generating:
      <ns:application>
      <ns:createDate>2007-12-18T15:14:57Z</ns:createDate>
      <ns:events>
      <item>
      <item>
      <createDate>Thu Oct 18 18:39:50 GMT-0600 2007</createDate>
      </item>
      </item>
      </ns:events>
      </ns:application>

      And here is what I need:

      <ns:application>
      <ns:createDate>2007-12-18T15:14:57Z</ns:createDate>
      <ns:events>
      <item xsi:type="ns:Event">
      <ns:createDate>2007-12-18T15:14:57Z</ns:createDate>
      </item>
      </ns:events>
      </ns:application>

      Does anyone know how I can get ActionScript to produce that XML?

      Thanks in advance,

      Steve