Select to view content in your preferred language

Getting asynchronous geoprocessing job results through Postman fails.. Help needed.

516
1
05-24-2022 04:25 AM
svdklei
New Contributor

Dear Community,

I'm trying to interact with an asynchronous gp service on the ArcGIS REST API backend through Postman but I'm getting stuck the moment I want to retrieve the results of the job. Can you help me identify the right query? 

The job that is run converts a polyline with trace design of a specified project number into a polygon in GeoJSON format.

I'm able to submit a job with:
{{Server}}/rest/services/Geoproces/{{Service}}/GPServer/{{task}}/submitJob?f=pjson&{{Input_parameter... 

This returns:

 "jobId": "jd500252b090945e1812132a7b223c4a5",
 "jobStatus": "esriJobSubmitted"

So far, so good. When trying to retrieve the result however with the following query:
{{Server}}/rest/services/Geoproces/{{Service}}/GPServer/{{task}}/jobs/jd500252b090945e1812132a7b223c... 
an empty value is returned:

 "paramName": "{{Result parameter}}",
 "dataType": "GPString",
 "value": null

While I’m expecting a GeoJSON string as the value.

I checked the jobInfo through a query as well and apparently the job fails somehow.. Although when submitting the job through the REST html interface or through the toolbox in ArcGIS Pro it runs succesfully in both cases. With this query I check the jobInfo:
{{Server}}/rest/services/Geoproces/{{Service}}/GPServer/{{Task}}/jobs/jd500252b090945e1812132a7b223c...

This returns:

 "jobId": "jd500252b090945e1812132a7b223c4a5",
 "jobStatus": "esriJobFailed",
 "messages": [
 
   "type": "esriJobMessageTypeInformative",
   "description": "Submitted."
  ,
 
   "type": "esriJobMessageTypeInformative",
   "description": "Executing..."
  ,
 
   "type": "esriJobMessageTypeError",
   "description": "Traceback (most recent call last):\n  File \"F:\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\Geoproces\\ExportTraceontwerp.GPServer\\extracted\\p20\\03_-_code_bestanden\\TraceontwerpTool.py\", line 71, in \u003cmodule\u003e\n    \n  File \"F:\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\Geoproces\\ExportTraceontwerp.GPServer\\extracted\\p20\\03_-_code_bestanden\\TraceontwerpTool.py\", line 11, in main\n    \"\"\" Get traceontwerp geometry based on projectnummer from the feature service \"\"\"\nIndexError: list index out of range\n"
  ,
 
   "type": "esriJobMessageTypeError",
   "description": "Failed to execute (Export traceontwerp)."
  ,
 
   "type": "esriJobMessageTypeError",
   "description": "Failed."
 
 ]

Can you help me out with some advice on this matter? Am I missing something?

That would be much appreciated!

0 Kudos
1 Reply
Raul_Jimenez
Esri Contributor

Hi @svdklei ,

Get traceontwerp geometry based on projectnummer from the feature service
IndexError: list index out of range

It seems pretty clear to me that this is a problem with the input parameters, I imagine that's why you are getting an empty response.

So considering that submitting the job through the REST HTML interface works successfully, I would copy the network requests being sent (as "CURL") and import them into Postman (File > Import > Raw text). Hopefully, that will help you find the differences between the input you are sending right now and the one from the HTML interface (that's how I solve many of the problems I have).

0 Kudos