I have published a Toolbox to ArcGIS Server as a geoprocessing service and am trying to access the service via .NET. I get an error message telling me the job has failed after running the following code:
IVariantArray parameters = new VarArrayClass(); parameters.Add(@"D:\workspace\Temp\Untitled.mxd"); parameters.Add(@"D:\workspace\Temp\Base_Map.lyr"); parameters.Add(@"D:\workspace\Temp\new.mxd"); IGeoProcessorResult result; result = (IGeoProcessorResult)gp.Execute("AddLayerToMap", parameters, null);
The ArcGIS Server has ArcGIS Server security in place and this looks like the problem because if I access the toolbox directly via its location on disk, the code works.
How do I pass credentials to an ArcGIS Server Geoprocessing Service?