我遇到了Magento multiCall的问题。我有一个自定义PHP脚本,用于更新商店中的产品。该剧本几年前成功运作,但随后突然停止了。
错误
Fatal error: Uncaught SoapFault exception: [1] Internal Error. Please see log for details. in /htdocs/scripts/euronics_update.php:422
Stack trace:
#0 /htdocs/scripts/euronics_update.php(422): SoapClient->__call('multiCall', Array)
#1 /htdocs/scripts/euronics_update.php(422): SoapClient->multiCall('7a7bb80602974f5...', NULL)
#2 {main}
thrown in /htdocs/scripts/euronics_update.php on line 422
我的代码
// collect 10 products information and execute as multiCall to speed up process
//
//$count_calls_array++;
$count_running_pos++;
//if ($count_calls_array > 10 || ($count_running_pos + 1) == count($data_all))
if (count($calls) > 3 || ($count_running_pos + 1) >= count($data_all))
{
//
// store product to Magento
//
if ($error_counter > 0)
{
echo "continued after error\n";
$error_counter = 0;
}
try {
$result = $client->multiCall($session, $calls);
} catch (Exception $e) {
$error_counter = 1;
echo "* * * " . $e->getMessage() . " * * *\n";
//echo "error occured, trying to restart. dump:\n".var_dump($calls)."\n";
$result = $client->multiCall($session, $calls);
echo "error resolved\n";
}
echo date('d.m.Y H:i:s').'---'.$count_running_pos.' -- '.count($calls).'<br>';
ob_flush();
flush();
// clear array
while (count($calls) > 0)
{
$tmp = array_pop($calls);
}
//$count_calls_array = 0;
}
提前致谢!
理查德