My apologies, based on my testing, this appears to be a bug in 10.1 final.That said, it doesn't reproduce on 10.1 SP1 (which is currently undergoing final testing and will hopefully be available for release within the next 2 months).At this time I can provide you with 2 workarounds to the issue:1) Modify your code to something like this:import arcpy if __name__ == '__main__': fc = arcpy.CreateFeatureclass_management(arcpy.env.scratchFolder, "fc1", "POINT", "", "DISABLED", "DISABLED", "", "", "0", "0", "0") arcpy.Delete_management(fc)
This no longer puts the output to the in_memory workspace, it now puts it to disk (a folder) - but will publish successfully. This is the easiest most straight forward workaround.2) If you want to continue to write to in_memory, you'll have to modify your script and parameters a little bit.import arcpy if __name__ == '__main__': inWorkspace = arcpy.GetParameterAsText(0) fc = arcpy.CreateFeatureclass_management(inWorkspace , "fc1", "POINT", "", "DISABLED", "DISABLED", "", "", "0", "0", "0") arcpy.Delete_management(fc)
>> new parameter in the first position (0-indexed) of type string, with input value of "in_memory"Then.... you run this, get your result and publish. When inside the Service Editor (publishing your service), go to that parameter (in this case, the first one), and change the Input Mode to "constant". This hardcodes it and the user of your service doesnt set it and your tool will continue to use in_memory.I understand neither are ideal, but they'll move you forward till SP1 is available.edit: The bug information is: NIM084303 - When publishing a simple script that references the "in-memory" workspace, the analyzer says the "Data source used by Script is not registered with the server and will be copied to the server: in_memory." Then the publish will fail to create a service definition.