0
Please someone help me, I need to return all the data. but it only returns the first one how do I return all results , the code I am using is this
try {
$opts = array(
'http' => array(
'user_agent' => 'PHPSoapClient'
)
);
$context = stream_context_create($opts);
$wsdlUrl = 'xxx';
$soapClientOptions = array(
"login" => "xxxx",
"password" => "xxxx",
"stream_context" => $context,
"cache_wsdl" => WSDL_CACHE_NONE
);
$client = new SoapClient($wsdlUrl, $soapClientOptions);
echo $status = (string) simplexml_load_string(
$client->RealizarConsultaSQL
([
'codSentenca' => 'xxxx',
'codColigada' => 'xxxx',
'codSistema' => 'xxxx',
'parameters' => 'xxxx'
])
->RealizarConsultaSQLResult)->Resultado->xxx;
}
catch(Exception $e) {
// echo $e->getMessage();
}
This is the return by SOAPUI, look how it returns all the results! more in the code above it only appears the first so:
You just gave a
echo
; if there are multiple records you should not have a repeat loop?– Woss
Good afternoon! I am not managing to make that loop I have tried all! can help me.. I just need it to finish, help me!
– user93341
Have you tried giving a
var_dump
on the object that is the result ofsimplexml_load_string
? It would be good for you to do this and [Dit] your question to add this result. That way your problem would be seen quickly by the community and solved quickly.– fernandosavio
Good afternoon Hoping, I was able to solve the problem was just removing ->Result->xxx; and now bringing all the results! print_r($arr = json_encode($status_CODIGO , 1); now how do I handle it in my JS? wanted to bring the result to a select within my html
– user93341