Link to home
Start Free TrialLog in
Avatar of mark_06
mark_06

asked on

PHP CURL SOAP XML to Array

Hi,

I am getting the following SOAP output from a returned CURL message. I am looking to get the below returned variables and put them into an array or some form of usable data. Where I get the name etc... in a usable format.

Using PHP what is the best way? I have looked to use json but can't get it to work.

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getUserResponse xmlns:ns="http://www.cisco.com/AXL/API/10.5"><return><user uuid="{3E0D6C9A-60AD-CFEB-9FF9-D74AB9B5A5C2}"><firstName>Mark</firstName><middleName/><lastName>Test</lastName><userid>mtest</userid><mailid/><department>IT</department><manager/><userLocale /></user></return></ns:getUserResponse></soapenv:Body></soapenv:Envelope>

Open in new window

Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

XML and JSON are both transport mechanisms, but they use different data formats.  Usually the best way to get XML data strings into a usable form is to use SimpleXML.  It's documented in the online PHP manual.   I'll try to give you an example.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial