Check out mx.utils.ArrayUtil.toArray().  You may need to call that to make sure that when you pass a single item it still gets treated as an array.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of cgobble
Sent: Wednesday, June 15, 2005 7:36 AM
To: [email protected]
Subject: [flexcoders] Collections between Flex and Web services

 

Hello,

I'm trying to return complex types with collections from a web
service and everything seems to work fine.  But, when I send the
type as the input parameter for the web service, if there is only 1
item in the collection it does not get back to the web service.

For instance, you have a Contact object in a dotnet web service. 
The Contact has a collection of phone numbers.  I simply want to
pass the entire Contact object back and forth between the web
service and Flex.
I create a method on the web service such as:  (VB)

Public Sub SaveContact(Contact as Contact)

End Sub

However, it seems that if I only have 1 phone number, the phone
number gets lost in translation, even though the Contact info comes
back correctly.  I was able to partially fix this by making sure my
collections were instantiated in the constructor, but if I nest a
collection, it doesn't seem to work right.

Any ideas??







Yahoo! Groups Links

Reply via email to