This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.1 » symfony and XML for a Flex application
symfony and XML for a Flex application [message #55192] Mon, 30 June 2008 18:39 Go to next message
cthulhu  is currently offline 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 #55209 is a reply to message #55192 ] Mon, 30 June 2008 22:21 Go to previous messageGo to next message
cthulhu  is currently offline cthulhu
Messages: 48
Registered: February 2006
Member
I realized that a simple xml file gives curl a Content-Type: application/xml header, not text/xml as my symfony action.
Could it be that? Should I force the content type? or there's a better solution?

Thanks
Giorgio
Re: symfony and XML for a Flex application [message #55269 is a reply to message #55192 ] Tue, 01 July 2008 12:39 Go to previous message
cthulhu  is currently offline cthulhu
Messages: 48
Registered: February 2006
Member
Up.
Any idea?
Previous Topic:[SOLVED] Phing::printVersion error
Next Topic:Customizing forms -- where?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software