Hello to the community,I would like to receive any help,this time is quite important.
I have to establish a communication protocol with a server based on an exchange of data in xml format.
They write to me:
"Requests are sent from Client to our Server in XML format included in HTTP post.The XML should be supplied as a post-parameter called XMLDATA.After the request has been processed
a feedback is returned back to client as an XML-document over the originating HTTP session."
Now,I think to be perhaps right if to POST I write :
<?
$xml = "<?xml version=\"1.0\"?>";
$xml .= "<Session>";
$xml .= "<Identification>";
$xml .= "<UserName>$username_int</UserName>";
$xml .= "<Password>$password_int</Password>";
$xml .= "</Identification>";
$xml .= "<Information>";
$xml .= "<Data>$data</Data>";
$xml .= "</Information>";
$xml .= "</Session>";
$ch = curl_init();
curl_setop($ch,CURLOPT_URL, "http://server.com");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$xmldata = curl_exec($ch);
curl_close ($ch);
?>
But maybe there is anything wrong.
Now,could anybody suggest me a good solution to GET the data they send me back every POST I do?