I m using flex as a front end.I have taken text area on the form and
trying to display a text in dat text area.I hav created ruby
application and i have written one method 'say' in app/controller/
video_controller.rb.And in flex i m using http service.
flex code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" initialize="ini(event)">
<mx:Script>
<![CDATA[
private function ini(event:Event):void
{
textser.send();
}
private function resulthand(event:Event):void
{
text1.text=String(textser.lastResult);
}
]]>
</mx:Script>
<mx:HTTPService id="textser" url="
http://localhost:3000/video/say"
useProxy="false" method="GET" result="resulthand(event)"/>
<mx:TextArea id="text1" x="162" y="134"/>
</mx:Application>
Here video is name of the controller and say is method name defined in
video_controller.rb file.
content of video_controller.rb:
class VideoController < ApplicationController
def say
render:xml => "Hello world"
end
end
when i m running the flex application, m getting run time 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/video/say"]. URL:
http://localhost:3000/video/say"]
at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/
internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at DirectHTTPMessageResponder/errorHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/redirectEvent()
I am not able to understand wot is the problem.Please reply as soon as
possible.Thanx in advance.