As per the title, I'm using cURL to connect up to my webservice which should then output the response in XML format. cURL is enabled on the server as per my check, however it isn't displaying anything in the response of $xml
.
define('SERVICE_URL', 'http://www.myurl.com/webservices/users');
define('USERNAME', 'user');
define('PASSWORD', 'pass');
//define('KEY', 'YOUR_KEY/SID_HERE');
$post = array(
'UserID' => '5',
'Name' => 'John',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, SERVICE_URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXMLElement($result);
echo $xml;
if(curl_errno($c))...
now. – DT.DTDG May 7 at 2:56