I parsed HTML content as a SOAP response but I can't retrieve it in client.
This is the PHP code I used to parse the SOAP response:
$obj = simplexml_load_string(read_file('../soap.xml'));
var_dump($obj->children('http://schemas.xmlsoap.org/soap/envelope/'));
Here is the SOAP response:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetDetailsResponse xmlns="http://192.168.2.34:180/">
<GetDetailsResult><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
</GetDetailsResult>
</GetDetailsResponse>
</soap:Body>
</soap:Envelope>
It shows the following error:
A PHP Error was encountered
Severity: Warning
Message: simplexml_load_string(): Entity: line 1: parser error : XML declaration allowed only at the start of the document
Filename: controller.php
Line Number: 60
A PHP Error was encountered
Severity: Warning
Message: simplexml_load_string():
A PHP Error was encountered
Severity: Warning
Message: simplexml_load_string(): ^
Filename: controller.php
Line Number: 60
Please help me parse it using PHP?