어떤 이유로 든 내 응용 프로그램이 오늘 아침에 작업을 중단했습니다.여기 API는 배치 작업을 실행하지 않고 항상 허용 된 상태를 반환합니다.
$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);
}
이 예제 batchjob의 내용이다 : 그것은 상태입니다에 대한 요청을 할 때 작업을 제출 한 후, 그것은 단지 여기
accepted
내가 작업을 생성하고 실행하는 데 사용하고 코드의 반환 이 .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
만들고 작업을 실행 한 후 나는 상태의 확인은 다음 컬 요청에 매 10 초마다 :
$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);
}
그러나 항상 다음 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>
, 내 응용 프로그램 코드 & 앱 ID는 모두 유효합니다, 그래서 난 정말 이런 일이 왜 이유를 볼 수 없습니다.
official docs에 따르면 내 첫 번째 cURL 요청은 &이라는 작업을 시작해야하지만 어떤 이유로 그것이 절대로 안되는 것 같습니다. 여기에 무슨 문제가있을 수 있습니까?
나는 그게 문제라고 확신한다. 며칠 후에 모든 것이 정상으로 돌아갔다. – PeterInvincible