0
Hello, I’m not very familiar with this kind of feedback on a Soapclient request (by the way, I’m not very familiar with SOAP). The return has an "example]] element, and when I try to read the file, it prints the whole in a single string.
$url = "http://localhost:12/mtd1/mtd.asmx?wsdl";
$clientSoap = new SoapClient($url, array('soap_version' => SOAP_1_2));
$params = array('Usuario'=>'user', 'Senha'=>'1234', 'limite'=>$ultima);
$positions = $clientSoap->BuscaEventos($params);
It returns something like:
<BuscarEventosResponse>
<BuscarEventos>
<![CDATA[<TeleEvento> <NumeroSequencia>1010</NumeroSequencia></TeleEvento>]]
</BuscarEventos>
</BuscarEventosResponse>
When listing the child elements of the Search tag, it returns a single string eliminating the children. Could someone assist me in this "problem"?
"it returns a single string eliminating the children", could detail this part better?
– Woss
When I receive it, it is in this format <![CDATA[<Teleevent> <Numerosequencia>1</Numerosequencia> <Idseqmsg> 95372 </Idseqmsg></Teleevent>]] picking up by Soapui, by PHP when I print the screen, it returns like this: string(636012) " 1 95372 0 0 1 92 22/12/2018 02:59:09 0 34 E8B69 03. Like a single string
– Alessandro Dias de Sá
Yes, because it is an XML within the string. It appears this way because you tried to display the XML inside an HTML without escaping it. If you want to extract the data from this string, you will need to parse it as XML.
– Woss
Thanks @Anderson Carlos Woss, that’s right, I used new Simplexmlelement value returned and it generated an object with the xml fields.
– Alessandro Dias de Sá