I get an array from other website with helping SOAP client, it’s quite big array, you can check it out short version here
An array
I need to get category names, my code is here, it works but slows website down. if anyone can provide better code.
$client = new nusoap_client('http://87.253.63.146/b2b/b2bWS?WSDL', 'wsdl');
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;
$parametrebi = array('user' => '','brand' => '', 'vat_zone' => 'GEVAT', 'currency' => 'GEL', 'all_items' => 'Y', 'page_num' => '1', 'lines_per_page' => '25');
$result = $client->call('GetPriceList', $parametrebi, array('return' => 'xsd:string'), "");
foreach($result['PriceList']['categories']['category'] as $category)
{
echo '<option value="'.$category['!id'].'">'.$category['!name'].'</option>';
}
Do the categories change that often?
Cant you poll for the categories every so often?
Eg every 5 min or so make this soap call and either save the categories to a table in the DB (not such a good idea) or memcache.
http://memcached.org/
If you can use memcache…here is a ruff example:
You can set the expire time on memcache to 1,2,5…ect minuites so the categories will be updated every time the cache expires. Other then when the cache expires the lookup time will be less then 5-10ms.