flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Baird <mba...@kairyt.com>
Subject Re: [Flex-WCF] Complex type result ArrayCollection contains ArrayCollection
Date Thu, 18 Apr 2013 15:59:08 GMT
FYI for those who are looking for a solution... I fixed this by not
creating a default, empty ArrayCollection in my VO constructors/accessors.
Another tip (forgot link, sorry) indicated the decoder didnt know if it
should overwrite or fill an existing collection, so it chooses the latter.
If the collection is null, then it will set it directly.


On Thu, Apr 11, 2013 at 10:52 AM, Michael Baird <mbaird@kairyt.com> wrote:

> Hi,
> I have a Flex 4.6 project communicating with .NET 4.5 through WCF
> WebServices. I've been struggling with passing complex types from .NET to
> Flex - they were always returning as ObjectProxy until I found this tip[1]
> about using the SchemaTypeRegistry to map classes.
>
> Now I have the root types returning correctly, but if the type contains a
> List<T>, the first element is another ArrayCollection (or Array if I have
> *makeObjectsBindable=false*). So I end up with:
>
> result ->
>     MyType
>         listOfItems : ArrayCollection (correct)
>             [0] ArrayCollection (extra - wrong)
>                 ItemA
>                 ItemB
>                 ...
>
> This is what I am expecting:
>
> result ->
>     MyType
>         listOfItems : ArrayCollection
>             ItemA
>             ItemB
>             ...
>
> The SOAP response is correct and doesn't contain the nested collection, so
> I think it is something in the decoder. Is there a property or
> configuration I can try to fix this?
>
>
> [1]
> http://www.patrick-heinzelmann.de/blog/2010/08/12/tips-and-tricks-to-use-soap-webservice-with-flex/
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message