A API HERE nunca executa tarefas em lote, sempre retorna o status aceito
Por algum motivo, meu aplicativo parou de funcionar esta manhã. Após enviar um trabalho, ao fazer uma solicitação para seu status, ele retorna apenasaccepted
Aqui está o código que estou usando para criar e executar o trabalho:
$url = "https://batch.geocoder.api.here.com/6.2/jobs?action=run&app_code=".$app_code."&app_id=".$app_id."&[email protected]&outcols=latitude,longitude,locationLabel&outputcombined=true&indelim=|&outdelim=|&language=hu-HU&header=true";
if($cURLHandler) {
curl_setopt($cURLHandler, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));
curl_setopt($cURLHandler, CURLOPT_BINARYTRANSFER, true);
curl_setopt($cURLHandler, CURLOPT_POST, true);
curl_setopt($cURLHandler, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURLHandler, CURLOPT_POSTFIELDS, file_get_contents($userFolderURL."/batchjob.txt"));
curl_setopt($cURLHandler, CURLOPT_URL, $url);
$cURLResults = curl_exec($cURLHandler);
curl_close($cURLHandler);
}
Este é o conteúdo de um exemplo batchjob.txt:
recId|searchText|country
1|"2120 Dunakeszi Barátság útja 18"|HUN
2|"2120 Dunakeszi Barátság útja 18"|HUN
3|"2120 Dunakeszi Baràtsàg útja 12"|HUN
4|"2120 Dunakeszi Barátság utja 49"|HUN
5|"2120 Dunakeszi Barátság útja 3"|HUN
6|"2120 Dunakeszi Barátság útja.30"|HUN
7|"2120 Dunakeszi Bátorkeszi utca 7."|HUN
8|"2120 Dunakeszi bercsényi u 27"|HUN
9|"2120 Dunakeszi Déli utca 12."|HUN
Depois de criar e executar um trabalho, verifico seu status a cada 10 segundos com a seguinte solicitação cURL:
$url = "https://batch.geocoder.api.here.com/6.2/jobs/".$requestID."?action=status&app_code=".$app_code."&app_id=".$app_id;
$ch = curl_init();
if($ch) {
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain'));
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch);
}
Mas sempre retorna o seguinte xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:SearchBatch xmlns:ns2="http://www.navteq.com/lbsp/Search-Batch/1"><Response><MetaInfo><RequestId>REQUESTID ommited</RequestId></MetaInfo><Status>accepted</Status><TotalCount>0</TotalCount><ValidCount>0</ValidCount><InvalidCount>0</InvalidCount><ProcessedCount>0</ProcessedCount><PendingCount>0</PendingCount><SuccessCount>0</SuccessCount><ErrorCount>0</ErrorCount></Response></ns2:SearchBatch>
Verifiquei duas vezes, meu código do aplicativo e o ID do aplicativo são válidos, então não vejo realmente o motivo pelo qual isso está acontecendo.
De acordo comdocumentos oficiais, minha primeira solicitação cURL deve criar e iniciar o trabalho, no entanto, por algum motivo, parece que nunca acontece? Qual pode ser o problema aqui?