From: Jano Svitok Date: 2008-03-28T16:31:21+09:00 Subject: Re: Issues with Ruby trying to parse data passed from Flex app On Fri, Mar 28, 2008 at 6:36 AM, Rajat Garg wrote: > Hi Guys, > > I have a Ruby API that is getting called by a Flex app using POST. The > problem is as long as data is in the format of - > > user[name]=alsk > user[email]=klsd > user[pass]=03493 > > it is fine. But, when it has say two root elements like, > > user[name]=alsk > user[email]=klsd > user[pass]=03493 > fc_id =232 > > It will start crapping out with error messages like - > Session ID: e3fe6e12eb9f685d82d87f413590efa9 > Parameters: {"format"=># "application/x-xml"], @symbol=:xml, @string="application/xml">, > "exception"=>"# start\nLine: \nPosition: \nLast 80 unconsumed characters:\n > nuwan@nuwan.comnuwan\n/usr/local/lib/ruby/1.8/rexml/parsers/baseparser.rb:346:in > `pull'\n/usr/local/lib/ruby/1.8/rexml/parsers/treeparser.rb:21:in > `parse'\n/usr/local/lib/ruby/1.8/rexml/document.rb:190:in > `build'\n/usr/local/lib/ruby/1.8/rexml/document.rb:45:in > `initialize'\n/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/vendor/xml_simple.rb:952:in > > > > What is the problem? Can I only pass 1 record with a set of values or can I > pass two records. Same thing works for GET. The error message is about malformed XML. Maybe you could look at the xml source to see what's wrong. For example - there's tag that seems wrong. Other than that, it would help if you specify what framework are you using (rails, active webservice, etc.) - this doesn't look like a plain POST request since XML somehow got into processing...