I'm new in SOAP and i'm having an issue in SOAP response.
My response is a xml
string with value:
<?xml version="1.0" encoding="UTF-8"?><InterXXXX><PDFXXXXs><PDFXXXX> <InterlXXXKey>19.1112</InterXXXKey><Data></Data><ResultCode>2500</ResultCode> <ResultMessage>this is a test</ResultMessage> <RecordDateTime>2014-12-18 23:56:06.761</RecordDateTime></PDFXXXX></PDFXXXXs></InterXXXX>
When I'm trying to do:
$result = simplexml_load_string($xml);
It doesn't create anything. But if i take the result and manual (copy-paste after print_r
) create a new value like this
$xml2 = '<?xml version="1.0" encoding="UTF-8"?> <InterXXXX> <PDFXXXXs> <PDFXXXX> <InterlXXXKey>19.1112</InterXXXKey> <Data></Data> <ResultCode>2500</ResultCode> <ResultMessage>this is a test</ResultMessage> <RecordDateTime>2014-12-18 23:56:06.761</RecordDateTime> </PDFXXXX> </PDFXXXXs> </InterXXXX>';
and call
$result2 = simplexml_load_string($xml2);
It doesn't have any problems and create SimpleXMLElement Object ()
with all tags elements inside.
Why is it happening?
How can I handle my response to take the values in the tags?