I am trying to output the contents of a web service using SOAP and PHP.
This is the code I have at present:
<?php
$params = array('Criteria' => array( // create "Criteria" array
'SearchType' => 'sales',
'MinPrice'=>400000,
'MinBeds'=>2,
'MinBaths'=>1,
'ShowSold' =>true,
'sortBy'=>'bedrooms',
'SortDescending'=>true,
'Limit'=>10,
'PropertyField'=>array('ID','Image','Address1','Address2','Postcode','PriceString')
));
?>
<?php
// Call the web service function and pass the parameters setup above.
$featured_properties = $client->call('GetSalesProperties',$params, $ns);
echo '<div class="results-list">';
foreach ($featured_properties as $featured) {
echo '<article class="property">' . $featured . '</article>';
}
echo '</div>';
print_r($featured);
?>
I have added the require_once to initialise the web service and used print_r just to see what should be output. Ideally, I would like the elements in the array to be wrapped in their own tags and each record to be in a containing article.
At the moment, I'm getting Array as my echoed content.
My PHP is basic and SOAP is something new so I need help please.