I'm trying to publish a GP tool that does some Network Analysis on a Network Dataset and in Pro, the toolbox input parameter is of type GPNetworkDataset. In Pro, I can just choose the network DS in the toolbox UI and everything works, but when published to the server, I'm unable to pass a NAServer URL as the value for the network dataset input, it tells me the input is not of the proper type. We have published the GP tool with this hardcoded to a gdb that we bundle in the service definition, but we need to be able to run this tool against multiple hosted NA Services.
Hey @NikMartin
Would you be able to show an example of the URL that you're attempting to enter? Both in the tool and also hardcoded? I would also recommend using "arcpy.AddMessage(URL)" and see if that shows anything unusual. I'm curious if OS carriage returns or some type of formatting is causing this to act strangely.
Cody
My First attempt was to pass the REST endpoint of the network dataset like:
https://localhost/server/rest/services/NETWORK-DEV/Austin_network/NAServer/net_ndI suspect the tool which tries to create a NetworkDatasetLayer like
arcpy.nax.MakeNetworkDatasetLayer(in_ds,out_layer) Can only handle a file geodatabase, NOT a network dataset service of type: esriNAServerNetworkDatasetLayer
I have since created a folder as a Data Store location on the server and have a copy of the Network dataset gdb there, but that's less than ideal since I have a perfectly good NA Service with that layer already there 🙂
One must remember that ArcGIS Server accesses file-based data sources, including network file shares, using its own credentials and not the credentials of the person who ran and published the tool. If the credentials running ArcGIS Server don't have access to the data set location, the tool will fail.
Yeah I'm trying to use a published NA service as a source for the network dataset. I have successfully used a folder as a data source with the gdb in it, but that creates logistical issues for keeping that data in sync with the published service. I'd really love to be able to do
nd = arcpy.nax.MakeNetworkDatasetLayer(path_to_NA_Service_layer)