I've been trying to setup a connection from a custom JS API webapp to use the Summarize Elevation GP Task. No matter what I do, the task fails with:
jobStatus: "esriJobFailed"
And the description for the failure is just "Failed.". The idea is that a user clicks a polygon, and in the infowindow is a button that allows them to get the elevation summary. When clicking the elevation button, it passes the selected feature to a function that submits the GP job. Below is a code snippet of what I've been trying:
getSlope: function (feature) {
var gpElev, params, featureSet, features = [];
gpElev = new Geoprocessor("http://elevation.arcgis.com/arcgis/rest/services/Tools/Elevation/GPServer/SummarizeElevation");
featureSet = new FeatureSet();
features.push(feature);
featureSet.features = features;
params = {
"InputFeatures": featureSet,
"DEMResolution": "FINEST",
"IncludeSlopeAspect": true
}
function elevSuccess (r) {
console.log(r);
}
function elevStatus (s) {
console.log(s);
}
function elevError (e) {
console.log(e);
console.log(params);
}
gpElev.submitJob(params, elevSuccess, elevStatus, elevError);
console.log(gpElev);
}
I've never really messed around with GP tasks from the web api so maybe I'm just doing something wrong here? Also I should note that I'm using a proxy to grab a token for the GP service, but I get the same results with or without.
All my features are in wkid: 102100 and are retrieved from Server 10.22 with a SQL Server enterprise DB. Web servers tried on both IIS on Server 2012 R2 and Apache2 on Ubuntu Server.