How to store SOAP returned value in PHP?
My PHP code using SOAP.
<?php
$client = new SoapClient("http://rscnagahrd/OracleWS/Oracle.asmx?WSDL");
$result = $client->getFoods();
echo $result;
?>
When I try to run the application I get the error:
Catchable fatal error: Object of class stdClass could not be converted to string in C:\apache\htdocs\food.php on line 4
I am doing this so that I could later parse the xml code:
$dom = new DomDocument;
$dom->preserveWhiteSpace = FALSE;
$dom->loadXML($result);
$params = $dom->getElementsByTagName('FOOD_ID');
foreach ($params as $param) {
echo $param -> nodeValue, PHP_EOL;
}