I am making a request in php via curl, and the answer is returning an xml, however I can not work with this xml ..
REQUIREMENT:
<br>
curl = curl_init('http://ws.targetmailing.com.br/consulta');<br>
curl_setopt($curl, CURLOPT_HEADER, false);<br>
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);<br>
curl_setopt($curl, CURLOPT_POST, true);<br>
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);<br>
$response = curl_exec($curl);<br>
curl_close($curl);
<br>
RETURN:
<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:resultado xmlns:ns2="http://ws.targetmailing.com.br/consulta" restricao="false" data="2016-04-29T07:42:59.456-03:00"><protocolo numero="1541656894" digito="9"/><operador codigo="1000" nome="INFOMAIL SERVICOS DE BANCO DE DADOS E INFORMATICA"/><consumidor><consumidor-pessoa-juridica data-fundacao="1990-01-01T00:00:00-03:00" nome-comercial="RAZÃO SOCIAL HOMOLOGAÇÃO" razao-social="A EMPRESA LTDA ME"><cnpj numero="74907134000142"/><endereco logradouro="R JOSÉ DA SILVA" numero="10" bairro="CENTRO" cep="01342000"><cidade nome="SÃO PAULO"><estado sigla-uf="SP"/></cidade></endereco></consumidor-pessoa-juridica></consumidor><spc><resumo quantidade-total="0"/></spc></ns2:resultado></S:Body></S:Envelope>
HOW I AM TREATING:
<br>
$result = simplexml_load_string($response);
ERROR:
Warning (2): simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found [APP/Controller/EcommerceController.php, line 832]<br>
Warning (2): simplexml_load_string() [function.simplexml-load-string]: <?xml version='1.0' encoding='UTF-8'?><S:Envelope [APP/Controller/EcommerceController.php, line 832]<br>
Warning (2): simplexml_load_string() [function.simplexml-load-string]: ^ [APP/Controller/EcommerceController.php, line 832]