ArcGIS Online Service Proxy job status returning "Invalid or missing input parameters."

679
0
09-19-2017 04:32 PM
AndyZeigert
New Contributor II

I've been trying to set up a simple esri-leaflet web application that sends a request to the ArcGIS Online Summarize Elevation service. In order to avoid sending my client ID and secret across the wire, I have set up a simple ArcGIS Online Hosted Proxy, following the instructions found here: Working with Proxy Services | ArcGIS for Developers 

I am using the esri-leaflet-gp plugin to submit my geoprocessing tasks and process the results. My task:

var elevationService = L.esri.GP.service({
 url: "http://utility.arcgis.com/usrsvcs/appservices/tGgqVVoHpHacidEV/rest/services/Tools/Elevation/GPServer/SummarizeElevation",
 async: true,
 path: 'submitJob'
}); 

I then create new tasks like so, where marker is a standard leaflet marker and elevationTaskCallback is a function that does stuff with the results:

var elevationTask = elevationService.createTask();
 elevationTask.setParam('DEMResolution', 'FINEST');
 elevationTask.setParam('InputFeatures', marker.toGeoJSON());
 elevationTask.setParam('IncludeSlopeAspect', false);
 elevationTask.setOutputParam('OutputSummary');
 elevationTask.run(elevationTaskCallback);

The service task then submits a geoprocessing task and polls every second for the status. Once the status is 'esriJobSucceeded', the resulting output is sent to my callback. The problem is, that status check is sometimes returning an error, which is weird, and breaks the esri-leaflet-gp code a little. I've isolated a few tasks and I honestly can't figure out why it produces an error so often. Here is an example job status request generated by my code that you can paste into a browser:

http://utility.arcgis.com/usrsvcs/appservices/tGgqVVoHpHacidEV/rest/services/Tools/Elevation/GPServe... 

If you refresh a few times, you should see the 400 error return sometimes, and a completed task message return other times. I would love to know how I could fix this so it returns the status consistently.

NOTE: This endpoint will eventually be locked down using an application referrer whitelist, but I've left it open temporarily in the hopes that someone can help me debug.

0 Kudos
0 Replies