当我尝试在Flash Builder 4 beta中执行更新时,收到以下错误消息:
[RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"]
at mx.rpc.http::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::processResult()[E:\dev\gumbo_beta2\frameworks\projects\rpc\src\mx\rpc\http\AbstractOperation.as:1022]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\gumbo_beta2\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:313]
at mx.rpc::Responder/result()[E:\dev\gumbo_beta2\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]
at mx.rpc::AsyncRequest/acknowledge()[E:\dev\gumbo_beta2\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:84]
at DirectHTTPMessageResponder/completeHandler()[E:\dev\gumbo_beta2\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:446]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
奇怪的是,几周前更新工作正常。我查看了不同的论坛,常见的回答是xml无效。但是,如果之前有效,我认为我的xml无效。这就是我所拥有的:
<fx:Declarations>
<mx:HTTPService id="student_requestsIndex" url="{CONTEXT_URL}/student_requests.xml"
resultFormat = "e4x"
result="student_requests=event.result as XML"/>
<mx:HTTPService id="student_requestsCreate" url="{CONTEXT_URL}/student_requests.xml"
method = "POST"
resultFormat="e4x"
contentType="application/xml"
result="student_requestsIndex.send()"/>
<mx:HTTPService id="student_requestsUpdate" url="{CONTEXT_URL}/student_requests/{student_requestsGrid.selectedItem.id}/confirm_request"
method="POST"
resultFormat = "e4x"
contentType="application/xml"
headers="{{X_HTTP_METHOD_OVERRIDE: 'PUT'}}" />
</fx:Declarations>
<mx:Form includeIn="Detail" x="-12" y="150" >
<mx:FormItem label="Student_num">
<s:TextInput id="student_numTextInput" text="@{student_requestsGrid.selectedItem.student_num}"/>
</mx:FormItem>
</mx:Form>
<s:Button includeIn="Detail" x="201" y="329"
label="{student_requestsGrid.selectedItem.id==''?'Create':'Update'}"
click="student_requestsGrid.selectedItem.id=='' ?
student_requestsCreate.send(student_requestsGrid.selectedItem) :
student_requestsUpdate.send(student_requestsGrid.selectedItem)"/>
来自Rails的xml(注意confirm_request实际上是一个更新操作):
<student_requests>
<student_request>
<student_num>5</student_num>
<student_status>confirmed</student_status>
<updated_at>2010-03-02T21:49:43Z</updated_at>
</student_request>
<student_request>
<student_num>5</student_num>
<student_status>confirmed</student_status>
<updated_at>2010-02-02T21:49:43Z</updated_at>
</student_request>
</student_requests>
有什么建议吗?感谢。