0

I need to send an array of objects from Flex to a Ruby Web service, but sending them as parameters is not getting through since they seen to come through as Objects instead of readable data.

Sending it as raw XML or JSON didn't work either so the last resort might be to send everything in a HTTP query. However, I'm not sure how to do this since the array contains objects, all of which have 4 or 5 properties, and I don't know what the right format would be. Help, anyone?

2
  • i believe you'll have to iterate thru each of the array's elements to create a simple array of strings before sending to your web service. read the answers to this SO question: stackoverflow.com/questions/252915/… Commented Dec 5, 2010 at 11:47
  • Hmm, thanks. I still don't see exactly how this would work as the array is multi-dimensional in the sense that it contains objects that contain different properties. Could anyone give me a simple example of a correctly formatted query string? Commented Dec 5, 2010 at 12:29

1 Answer 1

2

you should look for an AMF implementation of rails AMF - actionscript messaging format.

this way, you pass objects from the server to the client and the other way around, this means that when you send a list to the server, the list is of server object.

for example, if you have a Product object on the server and a Product object on the client you simply send an Arraycollection of Product to the server and iterate with rails

@products.each do |p| 

p will be Product.

there was an implementation of rails here http://blog.rubyamf.org/ although I don't know if it's still maintained.

I also found a good presentation of how to use it here: http://www.slideshare.net/railsconf/integrating-flex-and-rails-with-ruby-amf

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.