I want our users to have ability to determine the side of buffer (left/right) around a line feature.So, instead of Geometry service,I have published a GP service.It contains just one model (attached herewith) with only a buffer tool. GP service is published fine, I can see it in REST API.
However, when I use this service in code behind, I am getting an error 'GPTask 'SideBufferTool' does not exist or is inaccessible.'
Code: [PHP] //initialize gepreocessor task passing in the url of the published model. gpBufrTask = new Geoprocessor("http://gens003/ArcGIS/rest/services/SideBuffer/GPServer/SideBufferTool"); gpBufrTask.Failed += new EventHandler<TaskFailedEventArgs>(gpBufrTask_Failed); gpBufrTask.JobCompleted += new EventHandler<JobInfoEventArgs>(gpBufrTask_JobCompleted);
//define the input parmeters list List<GPParameter> inputParmas = new List<GPParameter>(); //geometry of the selected line feature inputParmas.Add(new GPFeatureRecordSetLayer("Input_Line", selectedStreetLst[0].Geometry));
//distance to buffer inputParmas.Add(new GPLinearUnit("Buffer_Distance", esriUnits.esriMeters,50));
//side to create buffer inputParmas.Add(new GPString("Side","LEFT")); //submit the job to gis server gpBufrTask.SubmitJobAsync(inputParmas); [/PHP]
I am not sure, why I am getting this error.I have granted the necessary permission for ArcGISSOC to the folder containing this toolbox.Otherwise, it would not allow me to publish the service in the first place.
Can anybody help me fix this error.Any help would be appreciated.