I am attempting to consume a rest service that I created here. Its just a simple network of streets in the Utah County, Utah area. Basically, it just shows the user the closest EMS service to the location that they choose. The model works in ArcMap 10.6, I simply click a point on the map and the service adds a model to my map with the EMS and closest route layer (Pictured below).

enter image description here

When I try to consume it as a service it doesn't quite work as I would expect though. I am just following the workflow that I found, but the object that is returned from the "Closest_Facility__2_" parameter does not seem to have any feature data in it. I have included a codepen here that shows all my code, unfortunately it cannot be run on codepen.io because of https/http errors, but if exported as a .zip, it can be run locally and it will work.


Your output, Closest_Facility__2_ is just a string. Odds are you have the output of the Solve tool as your terminal output in the model. This parameter is not supported in geoprocessing services, as such it gets converted to String and your service isn't giving you back your expected output (the shortest path).

If you add the Select tool onto the end, selecting the one piece you want from Solve you can set that output as a Parameter. (remove the P from the Closest Facility.) Republish this updated model and run it again.

Poking around your GIS Server, you want your REST endpoint of the service to look like Jeff's and his Route parameter: http://geoserver2.byu.edu/arcgis/rest/services/JEFFShortestRoute/CalculateShortestRouteJEFF/GPServer/Calculate%20Shortest%20Route

Check out this tutorial on creating shortest paths, specifically the picture of the model. You'll want to do something similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.