Help with sending XML object from Flex to php
I have an XML object i need to send from Flex to php so that php can write it to a file. I am trying to send it using HTTPService:
Code:
<mx:HTTPService id="sendXML" url="http://localhost/php/getXML.php" contentType="application/xml" useProxy="false" method="POST">
</mx:HTTPService>
And my getXML.php looks like this:
PHP Code:
<?php
$raw_xml = file_get_contents("php://input");
$myFile = "testFile.xml";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $raw_xml);
fclose($fh);
?>
After i do :
Code:
sendXML.request = inputXML; //inputXML is my XML object i am trying to send
sendXML.send();
I get the empty 'testFile.xml' file so i am obviously doing something wrong but can't figure it out what excatly :confused: Can someone please help me with this?
thanks in advance