[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request"

901 views
Skip to first unread message

shalini

unread,
Feb 15, 2008, 10:45:39 AM2/15/08
to Flex India Community
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.

Ajay k

unread,
Feb 15, 2008, 11:44:16 AM2/15/08
to flex_...@googlegroups.com
Hi Shalini

This error occurs when the url or file is blocked or not found by HTTPService call.

you can find more info here
http://www.judahfrangipane.com/blog/?p=87



With Regards
Ajay K
--
Ajay K

shalini

unread,
Feb 17, 2008, 7:07:55 AM2/17/08
to Flex India Community
thanx a lot....but still m not getting the solution....rather not
getting the mistake i did....

On Feb 15, 9:44 pm, "Ajay k" <ajaykempa...@gmail.com> wrote:
> Hi Shalini
>
> This error occurs when the url or file is blocked or not found by
> HTTPService call.
>
> you can find more info herehttp://www.judahfrangipane.com/blog/?p=87

Vinod M Jacob

unread,
Feb 18, 2008, 12:39:51 AM2/18/08
to Flex India Community
Hi-

This error occurres when your HTTPService couldn`t find the specified
url or the file at the specified url has an error.
try to type the url in a separate browser and see if the output is
available.....
> > Ajay K- Hide quoted text -
>
> - Show quoted text -

shalini

unread,
Feb 19, 2008, 11:35:56 PM2/19/08
to Flex India Community
hey thanx for the help...but still m getting the same error....dnt
know wot to do next..

gavin

unread,
Mar 1, 2008, 9:43:21 PM3/1/08
to Flex India Community
try to modify: /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/request_forgery_protection.rb

def verified_request?
!protect_against_forgery? ||
request.method == :get ||
!verifiable_request_format? ||
form_authenticity_token ==
params[request_forgery_protection_token]
end

to:
def verified_request?
!protect_against_forgery? ||
request.method == :post ||
request.method == :get ||
!verifiable_request_format? ||
form_authenticity_token ==
params[request_forgery_protection_token]
end

hope your enjoy it!
Reply all
Reply to author
Forward
0 new messages