Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't Get BlazeDS return results to be ArrayList in Flex

 
Al Johnston
Ranch Hand
Posts: 99
Flex Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Per Jeremy's - the author who participated in the forum this week - advice, I switched our web-service from SOAP to BlazeDS. Everything is running smoothly up to a point. I get two Maps back just as I expect to. However, I still can't get a List in Java to be an ArrayList in AS3. Can someone help me see what I need to change?

Here is the java code for the service:



I put the printouts on the server and see the videos return in 50 to 90 seconds - which is expected right now.

I have one object in Flex that does all my web-service work. It has a matching method for each method that is on the server. Since the server returns different result types, I have to be able to initialize differing types and objects based on what the caller is expecting. So, I have a resultHandler function in the Flex web-service object that knows what the caller is expecting. The caller registers with the web-service, waits to hear back and then the caller gets the type the caller is expecting. As an aside, I have to do a lot of rigmarole to avoid race conditions in Flex - if I ask for videos and expect that the screen won't load and the next method won't run until they come back, I'll be wrong so I have to make methods key off of one another and be very careful about what I let happen when. In any event, this caller is "holisticSelection" and is expecting to get back a List. I commented out the listObject instantiation and changed the results to a Map...



The if at line 11 will never run - even when listObject is instantiated. After first trying to cast the result as an ArrayList (which I want) and then an ArrayCollection (which didn't work either), I tried just getting it as an object in line 7. That works. If I have to, I will go back through my code and modify the objects that are looking for Lists to start working with Maps. Instead of that, I'd like to get the Flex code to work with the List. Is there some easy solution to this outside of just changing all returns into Maps?

Regards,
Al
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic