# Flex + Rails + Mysql Database Error

**URL:** <https://www.ruby-forum.com/t/flex-rails-mysql-database-error/129830>\
**Category:** Rails\
**Created:** [February 21, 2008, 11:03pm UTC](https://www.ruby-forum.com/t/flex-rails-mysql-database-error/129830 "2008-02-21T23:03:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 21, 2008, 11:03pm UTC](https://www.ruby-forum.com/t/flex-rails-mysql-database-error/129830/1 "2008-02-21T23:03:26Z")

</div>

Hi,  
I am integrating flex front end with rails back end. I am simply  
using XML formatted data.

If there is some data in the database then i am able to generate xml  
data through rails. and using HTTPServices i am displaying this xml  
data in flex front end using datagrid.

But when i want to insert some records in database it throws me an  
error

[RPC Fault faultString=“HTTP request error”  
faultCode=“Server.Error.Request” faultDetail=“Error: [IOErrorEvent  
type=“ioError” bubbles=false cancelable=false eventPhase=2 text=“Error  
#2032: Stream Error. URL: [http://localhost:3000/reviews/create](http://localhost:3000/reviews/create)”]. URL:  
[http://localhost:3000/reviews/create](http://localhost:3000/reviews/create)”]

HTTPService:

\<mx:HTTPService contentType=“application/xml”  
id=“reviewCreateRequest”  
url=“[http://localhost:3000/reviews/create](http://localhost:3000/reviews/create)”  
useProxy=“false” method=“POST”\>  
\<mx:request xmlns=“”\>  
  
{fTitle.text}  
{fAuthor.text}  
{fScore.text}  
{fText.text}  
  
\</mx:request\>  
\</mx:HTTPService\>

my controller looks like :

class ReviewsController \< ApplicationController  
def  
list  
@reviews = Review.find :all  
render :xml =\> @reviews.to\_xml  
end  
def create  
@review = Review.new(params[:review])  
@review.save  
render :xml =\> @review.to\_xml  
end  
end

I saw the rails log file. The xml data is which i am sending to  
database is there but cant write it to the database

Log file

Processing ReviewsController#create (for 127.0.0.1 at 2008-02-22  
01:17:05) [POST]  
Session ID:  
BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo  
%0ASGFzaHsABjoKQHVzZWR7ADoMY3NyZl9pZCIlYjUzYzJjZWQ3MjA2YWE3ZjE2%0AZWU4MGU3OWYwYzllOTI  
%3D–4d18c41667e30a8839a800fad2701d4b0c6303c6  
Parameters: {“review”=\>{“score”=\>“123”, “text”=\>“jkjfdfdf”,  
“title”=\>“RoR”, “author”=\>“XYZ”}, “action”=\>“create”,  
“controller”=\>“reviews”}  
.  
.  
.  
Rendering c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/  
action\_controller/templates/rescues/layout.erb (unprocessable\_entity)

I am following the same tutorial given here  
[http://www.liverail.net/articles/2006/4/16/rubyonrails-1-1-and-flex-2-0-pt-1](http://www.liverail.net/articles/2006/4/16/rubyonrails-1-1-and-flex-2-0-pt-1)

Is this a problem due to new rails version?

Any suggestion regarding this will be appreciated  
Thanks in advance  
Mukesh sahu
