Possible to provide inputs to geoprocessing service via URL

925
3
11-28-2017 03:22 PM
DevonCanady
New Contributor II

I have created a geoprocessing service by creating a tool from a python script, then running the tool in ArcCatalog on our server, and then Share As>Geoprocessing Service on the results in the Geoprocessing>Results window. The service was successfully created because I can see it in Server Manager.

The tool takes two inputs and outputs a file to a specified file path on the server, but I'm wondering if I can provide those inputs using query strings in the URL it created to the service. If not, how is the tool supposed to be given inputs?

I'm using ArcGIS Server 10.1 and Windows Server 2008.

Tags (1)
0 Kudos
3 Replies
JamesCrandall
MVP Frequent Contributor

Have you tried to add url parameters to the execute on the GP service?  Example:

ttps://mydomain.com/[ArcGISServer name]/rest/services/[folder name]/[GP Service name]/GPServer/GP service task name]/execute?InputParam1=somevalue&InputParam2=somevalue&env%3AoutSR=&env%3AprocessSR=&returnZ=false&returnM=false&f=json

What are those 2 input parameters?

0 Kudos
DevonCanady
New Contributor II

Yes, once I was able to go to the "Submit Job" page of the GP service I could provide input parameters either through the textboxes of the web page or through the URL query string. The two input parameters are a GUID for a job and a file path. The problem now is that it fails execution with out giving an error message, I suspect it might be because of the URL encoding of the file path. Do you know if you can provide a file path as a parameter via a query string?

0 Kudos
JamesCrandall
MVP Frequent Contributor

I added a possible solution to your post in the Python forum section.

0 Kudos