| symfony and XML for a Flex application [message #55192] |
Mon, 30 June 2008 18:39  |
cthulhu Messages: 48 Registered: February 2006 |
Member |
|
|
Hi,
I've a small flex application that populates its grid from XML.
I created a songs action and a songsSuccess.xml.php view:
<?php
$results[] = "<options>";
foreach ($songs as $song) {
$results[] = "<option><title>".$song->getTitle()."</title><author>".$song->getOwnerName()."</author></option>";
}
$results[] = "</options>";
print implode("\n", $results);
?>
XML is correctly generated, as an appropriate curl request demonstrate:
curl -H "Accept: application/xml" http://myapp.localhost/backend_dev.php/song/songs
<options>
<option><title>Imagine</title><author>John Lennon</author></option>
<option><title>Enjoy the Silence</title><author>Depeche Mode</author></option>
<option><title>Back for Good</title><author>Take That</author></option>
<option><title>Fake Plastic Trees</title><author>Radiohead</author></option>
</options>
here are curl dumped headers:
HTTP/1.1 200 OK
Date: Mon, 30 Jun 2008 16:13:59 GMT
Server: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.3
X-Powered-By: PHP/5.2.3-1ubuntu6.3
Set-Cookie: symfony=6bd012fb8a21e3b2cf18729a05ebcbec; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 316
Content-Type: text/xml; charset=utf-8
But I think there is a problem with content type or something similar, since the flex application fails to load data properly.
With a simple XML file, without passing through symfony, the flex application is feeded correctly.
Any idea?
Thanks
[Updated on: Mon, 30 June 2008 18:45]
|
|
|
|
| Re: symfony and XML for a Flex application [message #55269 is a reply to message #55192 ] |
Tue, 01 July 2008 12:39  |
cthulhu Messages: 48 Registered: February 2006 |
Member |
|
|
Up.
Any idea?
|
|
|