0 Replies Latest reply on Mar 2, 2010 6:06 PM by JohnMerlino

    [RPC Fault faultString=“Error #1090: XML parser failure: element is malformed.” faultCode=“Client.Co

    JohnMerlino Level 1

      Hey all,

      I get the following error message when I try to perform an update in 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()

       

      Strangely the update was working fine a couple of weeks ago. I looked at different forums and the common response is that the xml is invalid. However, I don't think my xml is invalid if it worked before. Here's what I have:

      <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)"
      />

      The xml from Rails (note that confirm_request is actually an update action):

       

      <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>

      Any suggestions? Thanks.