I'm using this code to get an xml file :
<?php
$username ="XXXX";
$password = "XXXX";
$url = 'XXXX';
$context = stream_context_create(array(
'http' => array(
'header' => "Authorization: Basic " . base64_encode("$username:$password")
)
));
$stringXML = file_get_contents($url, false, $context);
print_r($stringXML);
$stringXML = simplexml_load_string($stringXML);
echo "<br>";
print_r($stringXML);
My XML looks like:
<ns:getInfoResponse xmlns:ns="xxxx"> <ns:return> <result> <entry I_Personne="2291568592"> <loginGraceRemaining>10</loginGraceRemaining> <loginTime>20150827195311Z</loginTime> <loginDisabled>TRUE</loginDisabled> <isValidated>true</isValidated> <passwordExpirationTime>20160223195311Z</passwordExpirationTime> <mail_aai>xxxx.xxxx@xxxx.ch</mail_aai> </entry> </result> </ns:return> </ns:getInfoResponse>
My second print_r is returning this : SimpleXMLElement Object ( )
Why is it empty ?