Could you solve the "." problem. I cannot publish my service because of the dots in the layers name. Please let me know if you have any solution.
Description of issue in detail:
arcpy RasterDomain_3d r
I do not have any control on the name because the dots come from SQL server. When I switched the "." with "_", the output result is as follow:
If I publish the service, It will not run because of the new Dots!
This looks good and as expected.
GS --> Name of the database
DBO--> Schema that owns the data and was used to create the data
GS_DBO_test \ test--> name of the Object (table and Feature class)
So, I think you should posts a screenshot of the error you receive while Publishing and a brief outline of the workflow you are following to Publish.
Also the configuration details, such as:
I am creating a very simple service. the python code of script is:
r"Database Connections\GS.sde\GS_DBO_test", "POLYGON")
it works as a ArcGIS tool perfectly and generate the polygon output:
Then I shared the tool as Geoprocessing service. when I run the service on my ArcCatalog as follows:
I get the following error:
I do not know why the arcGIS server makes the same output in the a"scratch.gdb" in the server and fails because of the "Dots" in the name. As you know, ArcGIS does not accept Dot as a layer name in file Geodatabase.
I don't have a suggestion\solution to offer, however I have branched this out as a separate Post with all the details provided. Also shared this Post to the other relevant Groups.
First you should think about the final GP that you need. Currently the tool takes one layer and create a second one, both with hard coded names. Such a service should work only once...
Do you want the user to select a feature class for input? Are you sure all outputs should be written into the database (what happens if to users give the same output name)?
Usually the output of a GP tool is temporary and send only to the user that run the tool.
In general the server does not have "Database Connection" this is something that exists in your profile only.
You should put a sde connection file in a directory that is registered in the server (C:\temp\GS.sde) Then it will be recognize in the publish process and will not be replaced by scratch gdb.
In addition, please note that a valid name can be created using ValidateTableName—Help | ArcGIS Desktop .
The other thing is to revise the content (if you have access) of the script after it is published to AGS (look at a folder like: arcgisserver\directories\arcgissystem\arcgisinput\OptionalFolderName\YourServiceName.GPServer\extracted\v101) In many cases the content of the script will be changed.
When you create a geoprocessing service, you shouldn't set the output location to an SDE database when running the tool in ArcMap. That will create the name using the syntax for a FC in a geodatabase, (instance.owner.table) as you know. When you run the GP service, all output feature classes will be written to the scratch.gdb. Since it simply takes the original name and saves it to the scratch.gdb, the original name becomes invalid. Save the output to a file geodatabase when running the tool in ArcMap, then publish it. You can use the os module and arcpy.env.scratchGDB environment variable:
import arcpy, os