How to consume a GPService in desktop ArcObjects?

2311
1
05-14-2012 01:45 PM
SteveClark
New Contributor III
Probably a simple question but I am confused as to how to consume a GPService (from our server) in a desktop ArcObjects application. The rest service is http://myserver/ArcGIS/rest/services/CSUDataConversion/GPServer/GisToCad and the url is http://myserver/ArcGIS/services/CSUDataConversion/GPServer. All I got so far is:

IGeoProcessor2 geoprocessorTask = new GeoProcessorClass();
geoprocessorTask.AddToolbox(@"http://myserver/ArcGIS/services;GP/CSUDataConversion");
IVariantArray parameters = new VarArrayClass();
parameters.Add("out.dwg");
parameters.Add("param2");
parameters.Add("param3");
IGeoProcessorResult results = geoprocessorTask.ExecuteASync("GisToCad", parameters);

Is this even close to the approach I should be doing?
0 Kudos
1 Reply
FreddieGibson
Occasional Contributor III

I believe this is what you're looking for.

How to work with geoprocessing services

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000001qn000000

0 Kudos