Thank you Mike!!! This was EXACTLY what I was looking for. Once I have Flex
generate all of my VOs, I've added the following code to the sub-class's
constructor which does the trick for all of my web services without me
modifying the generated code.
public function MyClass() {
super();
for each (var operation:Operation in operations) {
operation.forcePartArrays = true;
}
Now all of my web services work as expected!
--- In [email protected], "Mike" <msl...@...> wrote:
>
>
>
> Michael,
>
> The Flex SDK can do what you want, but the default behavior is for it to
> unwrap collections and enclosing types which only contain one item. This
> default was not a good idea, IMO.
>
> Have you tried setting Operation.forcePartArrays true?
> http://livedocs.adobe.com/flex/3/langref/mx/rpc/soap/Operation.html#forcePartArrays
> You will need to obtain the mx.rpc.soap.Operation from the WebService first.
>
> You can alter the default behavior by writing a custom deserializer (which is
> a non-trivial task, made more difficult by the ASDoc being turned off.)
>
> For more information about Flex WebService, see my slide show and YouTube
> video at
> http://www.slideshare.net/mslinn/using-flex-with-enterprise-web-services
>
> Mike
>
>
> > I'm using Flex 4 and I set the returntype for the webservice to return an
> > array
> > of Cars - Cars[]. If the web service returns more than 1, it successfully
> > deserialized the data and returns an array of Car objects. BUT, if only
> > one is
> > returned, it returns an ObjectProxy, obviously because it cannot convert it
> > to
> > an array.
>