Results from geoprocessing job not being returned to client...

688
4
02-03-2012 08:51 AM
GISAdmin1
New Contributor III
I have published a geoprocessing job to ArcGIS Server.  I cannot seem to retrieve the resultant geometry from the job.  The job executes successfully as seen in the ArcGIS Server log and valid data in the output folder.

On the JavaScript API side - results[0] is undefined is returned from the job. 


gp.submitJob(params, getPlume);

function getPlume(results, messages) {
     console.log(results);
     var features = results[0].value.features;
}



Any ideas why I am not getting the geometry returned?  There is a valid shape file created in the output folder.

Thanks in advance,

M

ps - uses the same model as this:

http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/PublicSafety/EMModels/GPServer/ERGByChemi...
0 Kudos
4 Replies
nicogis
MVP Frequent Contributor
In fiddler or firebug net is result Ok?
what do you see in console.log(results); ?
0 Kudos
GISAdmin1
New Contributor III
I have attached the console representation of the results.  All appears well, except there is no geometry.

[ATTACH=CONFIG]11725[/ATTACH]

Also, I can successfully return the geometry if I manually plug in this URL:

http://vwgisrest/COSREST/rest/services/ERGModels2/GPServer/ERGByChemical/jobs/jc0bd4ea9f6874a2b8c866...
0 Kudos
GISAdmin1
New Contributor III
Problem Solved - use gp.execute, not gp.SubmitJob.
0 Kudos
derekswingley1
Frequent Contributor
Glad you got it fixed. For future reference, execute is for synchronous GP services while submitJob is for async GP services.
0 Kudos