Weedpacket;10907044 wrote:First part of the solution: don't use print_r; it's a debugging utility for developers who need to see inside an array or object.
Second part of the solution: use the [man]SimpleXML[/man] functions for accessing SimpleXML structures.
Thanks for the reply.
But, I was using print_r exactaly for that purpose, to see the structure of the XML returned.
Secondly, I already tired SimpleXML, something I'm usually good at, but for some reason I'm having trouble accessing any of the data, hopefully you can help.
I tried this . . .
// Send off SOAP request and get response back
$response = $soapClient->__doRequest($soapXml, $host, $soapActionXmlNS, "1.1");
// SimpleXML seems to have problems with the colon ":" in the <xxx:yyy> response tags, so take them out
$xmlStringnew = preg_replace('|<([/\w]+)(:)|m','<$1',$response);
$xmlString = preg_replace('|(\w+)(:)(\w+=\")|m','$1$3',$xmlStringnew);
// Use SimpleXML to parse response into object
$xml = new SimpleXMLElement($xmlString);
// SimpleXML object for tags in the <soapenv:Body> node
$result = $xml->soapenvBody->item->key;