Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I getting the " the remote procedure call failed "error message while running the following code....

enter code here //Here i am getting the polygon geometry from one featureclass......
           IGeometry queryGeom = getBasinGeometry(queryBasin);

            pservContext = SOM.CreateServerContext("ReportGen/buffer_clip", "GPServer");
            IGPServer pgpServer = pservContext.ServerObject as IGPServer;

            string taskName = "State_Clip";

            IGPToolInfo task = pgpServer.GetToolInfo(taskName);
            IGPValues taskValues = (IGPValues)pservContext.CreateObject("esriGeoprocessing.GPValues");
            IGPParameterInfos paramInfos = task.ParameterInfo;
            IGPParameterInfo paramInfo = null;
            string parameterStr = string.Empty;

            for (int i = 0; i < paramInfos.Count; i++)
                paramInfo = paramInfos.get_Element(i);
                //add to parametername strin.....
                parameterStr += paramInfo.Name;

                if (i != paramInfos.Count - 1)
                    parameterStr += ";";

            //Now start assigning input values....            
            IGPRecordSet gprecSet = (IGPRecordSet)taskValues.get_Element(0);
            IQueryFilter qf = pservContext.CreateObject("esriGeodatabase.QueryFilter") as IQueryFilter;

            IRecordSet rs = gprecSet.RecordSet;
            IFields flds = rs.Fields;
            int shpIndx = flds.FindField("SHAPE");
            IField fld = flds.get_Field(shpIndx);
            ISpatialReference inputrs = fld.GeometryDef.SpatialReference;
            IRecordSetInit rsi = (IRecordSetInit)rs;
            ICursor cur = rsi.Insert();
            IRowBuffer rb = rsi.CreateRowBuffer();

            IPolygon iplgon = (IPolygon)pservContext.CreateObject("esriGeometry.Polygon");
            iplgon = queryGeom as IPolygon;

            //IPoint ipnt = (IPoint)pservContext.CreateObject("esriGeometry.Point");
            //ipnt.PutCoords(4099805.666, 3444416.24);
            //rb.set_Value(shpIndx, ipnt);

            rb.set_Value(shpIndx, iplgon);

            //exception is occuring here..........

If i run a same kind of tool with esriGeometryPoint datatype as Input featureset, Working fine. But the problem is only with polygon data type.

Any suggestion will be useful

Thanks Srinivas...............

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.