If I understand you correctly (do not see a 'vect' variable anywhere), the web service is working perfectly. The getData() function is non-blocking and does not "wait" for the response from the web service. This is why you need to add an event listener, to listen for the "result" event. When the reply comes in, the listener triggers the handler (connectWsResult) which you appear to have defined correctly.
So I'm not sure what the problem is if you say the handler is returning the correct data. Am I missing something?
Yes, the web service works fine. The return type of the webservice is of type Vector and not ArrayCollections. I am getting a NULL when I invoke the result handler and store the result in Vector. However, I get the correct result when I store the result as an ArrayCollection.
My question is, how do I make the result handler store the result in a Vector.
1 person found this helpful
You're skimming on the edge of my knowledge here (which is apparently getting a bit dated), I think Vector is Flex 4 only while I'm still using 2/3 mostly, but if it's giving you an ArrayCollection when converting from a Java Vector, that's the standard Java Collection-to-ArrayCollection behavior. (I suppose they didn't alter the Java-Flex mappings in Flex 4.) I would imagine that if you want to use a Vector on the Flex side you'll need to create a new Vector instance and put everything in the ArrayCollection into the Vector yourself.
In case you're not aware - you're getting a null when you do an "as" cast to Vector because the cast is failing (since it's not a Vector object). (The type of object isn't decided by the cast, it's decided beforehand by Flex AMF deserialization code.)