Bonjour,

J'ai un petit souci. Voila, je récupére une chaine XML (grace a un service web) et je souhaiterai l'analyser.
Je pensais donc faire ça grace a la fonction simplexml_load_string. Cependant, cette fonction est censé me renvoyer un objet..or, il ne me renvoit rien...pourquoi ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
$client = new soapclient($wsdl,$options);
 
$test = $client->wsGetClientProfile($params);
$xml = $client->__getLastResponse();
 
echo "$xml";
 
$xml2 = simplexml_load_string($xml);
var_dump($xml2);
Et j'obtiens le message suivant :

object(SimpleXMLElement)#3 (0) { }

Le XML que je reçois est :
<?xml version="1.0" encoding="utf-8"?>
<ClientProfile xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xmlnssd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://XXXXXX/XmlSchema ClientProfile.xsd" xmlns="http://XXXXX">
<ClientId>11111</ClientId>
<PasDejaVus>false</PasDejaVus>
<Langue>1</Langue>
<Prevenu>true</Prevenu>
<Films>true</Films>
</ClientProfile>

Merci d'avance,