Posts: 2
Registered: ‎01-29-2014

Parsing Response from CIM in php

I am trying to parse the transaction ID in php from the xml response given after createCustomerProfileRequest. This is the l code I am using.

echo $response;

list ($refId, $resultCode, $code, $text, $customerProfileId) = parse_return($response);

echo "<br><br><br>".$customerProfileId."<br><br><br>";

When the response is echoed I can find the customer ID at the very end, but $customerProfileId doesn't return anything.

Thanks for the help 


Posts: 591
Registered: ‎08-21-2009

Re: Parsing Response from CIM in php

It doesn't look like you are using our SDK, so I can't really guess what is going on in the parse_return method that you referenced. If you would like to handle the XML directly, I would recommend converting it to a simpleXML object. You can then access the profile ID directly.


$response = simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOWARNING)
$customerProfileId = $response->customerProfileId