Reputation: 517
Later edit: Problem solved :).
Currently I am in the process of learning how to use Flex. For this reason I am following the tutorial provided here: http://www.adobe.com/devnet/flex/videotraining.html. I am working through exercise 1.04 now: http://www.adobe.com/devnet/flex/videotraining/exercises/ex1_04.html. I want to retrieve data from an XML file and show it in my application. Unfortunately, the URL provided by the Adobe Team [http://adobetes.com/f45iaw100/remoteData/employees.xml] is no longer working, so I created my own XML file and uploaded it here: http://www.mediafire.com/view/6kzv2wpb8652mqg/employees.xml. But when I use the Network Monitor tool in Adobe Flash Builder to see the info that I get, I receive the following message: "Body could not be parsed as valid XML/AMF/JSON file" [the transfer completes successfully].
My code is here:
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:HTTPService id="employeeService"
url=" http://www.mediafire.com/view/6kzv2wpb8652mqg/employees.xml"
/>
</fx:Declarations>
And in the Application tag I have:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="850"
creationComplete="employeeService.send()">
My XML file seems good constructed. Any clue about what could be wrong?
Thank you in advance.
Upvotes: 0
Views: 391
Reputation: 255
<s:HTTPService id = "httpId"
url = "yourPHPFileName.php"
method = "POST"
showBusyCursor = "true"
result = "HttpSignIn_ResultHandler(event)"
fault = "HttpFaultHandler(event)"
resultFormat = "xml"/>
Inside Result Handler you will get XML file, sent from PHP file.
Upvotes: 0
Reputation: 1591
I think the issue might be with how the xml is being served up -- the mediafire presentation of the xml isnt raw / native / pure xml? I could be wrong, but if it were me, first thing I would try out is firing up a text editor and saving a local copy of that raw / flat xml data and trying to read and parse or otherwise use that, then if that works, move that flat xml file to my own live server to see if reading it over http works, etc.
this tutorial / video helped me get up and running with it when I started with xml, but now I try to use JSON if I can. Good luck with it. If it helps I'll see if I can find a bare bones example I can share with you ... I experimented with some code early on that used live ESPN xml data from their awesome API and I think I still have some of those experiments / tests.
Upvotes: 1