Solved! Go to Solution.
Hello @PaolaM
$client = new SoapClient('http://example.com/index.php/api/soap/?wsdl'); $session = $client->login('xxxx', 'xxxxx'); // $productInfo is array which contains all product sku and its quantities which will update to another server $productInfo = array( array('sku'=>'sku1','qty'=>'50000'), array('sku'=>'sku2','qty'=>'110'), ); $start = microtime(true); foreach($productInfo as $product ) { $calls[] = array('product_stock.update', array($product['sku'], array('qty'=>$product['qty']))); } /* 2 products will go in one request to another server for product update stock data(in my case quantities) using SOAP API multiCall method IF YOU HAVE LOTS OF PRODUCT FOR UPDATE TO ANOTHER SERVER THEN YOU CAN REPLACE VALUE IN array_chunk function(in my case 2) 2 is total products data */ foreach(array_chunk($calls, 2) as $skuChunk) { $result = $client->multiCall($session, $skuChunk); } echo $time_elapsed_secs = microtime(true) - $start; // How many times will be elapsed for this operation
Hope it will help you.
If works then mark as the solution or give kudos.
Hello @PaolaM
$client = new SoapClient('http://example.com/index.php/api/soap/?wsdl'); $session = $client->login('xxxx', 'xxxxx'); // $productInfo is array which contains all product sku and its quantities which will update to another server $productInfo = array( array('sku'=>'sku1','qty'=>'50000'), array('sku'=>'sku2','qty'=>'110'), ); $start = microtime(true); foreach($productInfo as $product ) { $calls[] = array('product_stock.update', array($product['sku'], array('qty'=>$product['qty']))); } /* 2 products will go in one request to another server for product update stock data(in my case quantities) using SOAP API multiCall method IF YOU HAVE LOTS OF PRODUCT FOR UPDATE TO ANOTHER SERVER THEN YOU CAN REPLACE VALUE IN array_chunk function(in my case 2) 2 is total products data */ foreach(array_chunk($calls, 2) as $skuChunk) { $result = $client->multiCall($session, $skuChunk); } echo $time_elapsed_secs = microtime(true) - $start; // How many times will be elapsed for this operation
Hope it will help you.
If works then mark as the solution or give kudos.
It works, thank you!