将XML文件从Flex应用程序写回到Rails服务器
我有一个XML文件,我想将其发送到Rails服务器.为此,我使用以下代码:
I have a XML-file, which I want to send to a rails server. To do so I use the following code:
<mx:HTTPService id="dataService"
result="resultHandler(event)"
resultFormat="e4x"/>
在由保存按钮触发的功能中,我执行以下操作:
In a Function triggered by a save button, I do the following:
var params:Object = {};
params["xml_file"] = xmlDoc;
dataService.method = "POST";
dataService.url = "http://localhost:3000/containers";
dataService.send(params);
不幸的是,总是出现问题(见下文).如果删除params var,它将运行GET Request ...
Unfortunately there is always the Problem (see below) appearing. If I remove the params var, it runs a GET Request...
[RPC Fault faultString ="HTTP请求错误" faultCode ="Server.Error.Request" faultDetail ="Error:[IOErrorEvent type =" ioError"bubble = false cancelable = false eventPhase = 2 text =" Error#2032:流费勒. URL: http://localhost:3000/containers ].URL:
[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-Fehler. URL: http://localhost:3000/containers"]. URL: http://localhost:3000/containers"]
可能是什么问题?
感谢您的任何提示! 马库斯
Thanks for any hints! Markus
您的Flex代码正在调用容器控制器(/容器)的索引动作,但是,当您不发送任何参数时,Rails会将其视为get动作,请检查您的development.log文件以获取有关该错误的更多说明.
you flex code is calling index action of your containers controller(/containers) but, when you don't send any parameters Rails will treat it as a get action, Please check your development.log file for more description on the error.