POST
|
I figured out the issue. In the completeCallback function I had "jobinfo" instead of "jobInfo" which was generating the error. I thought I had seen "jobinfo" in some samples, and thus had tried testing first one and then the other capitalization but evidently missed this one when changing around. Thanks Rich for your help, much appreciated!
... View more
09-14-2012
06:21 AM
|
0
|
0
|
594
|
POST
|
According to the documentation the property is jobId not jobID - JS is case-sensitive so this explains the undefined on some of those lines 🙂 D'oh! It was staring right at me and I managed to overlook it, I guess that happens when you stare at something for too long. That did the trick, I will work on debugging the [object Error] at the end. EDIT: Correcting the property did not affect the [object Error]. I have attached the network log resulting from the job submittal in case that offers any insights.
... View more
09-14-2012
06:01 AM
|
0
|
0
|
594
|
POST
|
Thanks for the reply. I made the following changes: function geoprocessing(){
var polyArray = retrieveValues();
var gpurl = "http://server/ArcGIS/rest/services/ls_geoproc/GPServer/Landscan";
gp = new esri.tasks.Geoprocessor(gpurl);
var params = { "WKT":polyArray };
gp.submitJob(params, completeCallback, statusCallback, errorCallback);
}
function statusCallback(jobInfo){
// try to print the jobID here as well;
console.log(jobInfo.jobID);
console.log(jobInfo.jobStatus);
}
function completeCallback(jobInfo){
console.log(jobInfo.jobID);
console.log(jobinfo.jobStatus);
}
function errorCallback(error){
console.log(error.name);
console.log(error.message);
} And these print statements were in the console log: LOG: undefined
LOG: esriJobSubmitted
LOG: undefined
LOG: esriJobExecuting
LOG: undefined
LOG: esriJobSucceeded
LOG: undefined
[object Error]
[object Error] So the jobID appears to always be undefined. Also, I believe my error function is correct but I'm not sure.
... View more
09-14-2012
05:18 AM
|
0
|
0
|
594
|
POST
|
Hi all, I'm running into an issue retrieving the jobID of an asynchronous geoprocessing job. I am able to retrieve the jobStatus but the jobID is returned as undefined. I am using Internet Explorer 9 (due to interaction elsewhere in the code with ActiveX) and Server 10.0.0.0. As you can see below, the API is being hosted on my server because eventually the application will run on a server with no Internet connection, but the result is the same with the ESRI-hosted API. The relevant portions of the code are below: <script type="text/javascript" src="http://server/arcgis_js_api/library/3.1/jsapi/"></script> <script language="javascript"> function geoprocessing(){ // returns an array of well-known text values; var polyArray = retrieveValues(); var gpurl = "http://server/ArcGIS/rest/services/ls_geoproc/GPServer/Landscan"; gp = new esri.tasks.Geoprocessor(gpurl); var params = { "WKT":polyArray }; gp.submitJob(params, completeCallback, statusCallback); } function statusCallback(jobInfo){ console.log(jobInfo.jobStatus); } function completeCallback(jobInfo){ console.log(jobInfo.jobID); console.log(jobinfo.jobStatus); } Here are the print statements from the console log: LOG: esriJobSubmitted LOG: esriJobExecuting LOG: esriJobSucceeded LOG: undefined [object Error] [object Error] The job does in fact succeed (not sure why the object errors are occuring, could be related somehow?). Does anything look amiss in my code? Any help is greatly appreciated.
... View more
09-14-2012
04:29 AM
|
0
|
7
|
822
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|