Select to view content in your preferred language

Accessing ArcGIS Geoprocessing Service with Security .NET

608
1
06-09-2011 08:07 AM
MeleKoneya
Frequent Contributor
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: 

Geoprocessor gp = new Geoprocessor();
gp.AddToolbox(@"http://vmascgis01/arcgis/services;PrintLISMap");
                     gp.OverwriteOutput = true;

            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?
0 Kudos
1 Reply
LeoDonahue
Deactivated User
Does the SOM and SOC have access to D:\workspace\Temp ?

Do the users, assigned by ArcGIS Server security, have access to that directory?

Didn't you have to connect to the ArcGIS Server already using impersonation?  Such as:

http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/ArcGIS/ArcObjects/connect_gis_server....
0 Kudos