I can't read the XML response when using createCustomerProfileFromTransactionRequest
My Code . . .
$content_Create_CIM =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>".
"<createCustomerProfileFromTransactionRequest xmlns=\"AnetApi/xml/v1/schema/".
"AnetApiSchema.xsd\">".
"<merchantAuthentication>".
"<name>". $loginname . "</name>".
"<transactionKey>" . $transactionkey . "</transactionKey>".
"</merchantAuthentication>".
"<transId>" . $transID . "</transId>".
"</createCustomerProfileFromTransactionRequest>";
$response = send_request_via_curl($host,$path,$content_Create_CIM);
The CIM profile is created but I can't parse the response.
When I try . . .
$xml=simplexml_load_string($response);
I get . . .
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /home/XXXXXXXX on line 99 Warning: simplexml_load_string(): HTTP/1.1 200 OK in /home/XXXXXXXX on line 99 Warning: simplexml_load_string(): ^ in /home/XXXXXXXX on line 99
What simple function can I use to parse this?
Thank you
09-17-2015 08:15 AM
Hi Jim88763563,
This is only a warning and a known issue with the PHP simpleXML library reads XML from a Microsoft server. The easiest way to directly address this is simply to suppress warnings when parsing the XML.
$xml = simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOWARNING);
Thanks,
Joy
09-25-2015 01:13 PM
It took Eight days to get a response.
Is this normally how long it takes to get back to a customer?
09-25-2015 02:03 PM
This is a public forum and that not really a authorize.net issue but "known issue with the PHP simpleXML library reads XML from a Microsoft server. "
09-25-2015 04:55 PM