We have an eCommerce Web-site which sends XML messages to web-sites for suppliers. I want to try and setup a PHP page so that I can receive the XML messages on a website of my own and initially write the contents of the messages to a file.
So far I've been unsuccessful using a script which takes all the $_REQUEST variables and writes the contents to a file. This makes the assumption that the message sent will use an Http Post:
<?php
// open file for appending - Next line uses error suppression
$fp = fopen('./Xml/podata.txt', 'a+');
flock($fp, LOCK_EX);
if (!$fp)
{
echo '<p><strong> Cant write to file. '
.'Please try again later.</strong></p>';
exit;
}
foreach($_REQUEST as $key => $value)
{
fwrite($fp, $value, strlen($value));
};
flock($fp, LOCK_UN);
fclose($fp);
?>
However when I transmit an XML message from the eCommerce system nothing happens. I don't know what clever stuff is going on with the XML transmission but I've tried looking at various website searches and they return info on "SOAP", "XMLRPC", "SOCKETS", "Listeners" etc which all seem complicated.
Are there any definitive sources of information for XML transmission and receiving? I really want to use PHP if I can and keep it as simple as possible!