Hi all, I encounter a error when I consume my IDW(inverse distance weighted) geoprocessing service through ArcGIS Server SOAP API. Following is what i have done:??arcgis server java platform 9.2,desktop 9.2?? 1???create a model by arcgis desktop. 2???publish the toolbox as service to the arcgis server. 3???reference the SOAP API library(arcgis_agsws_stubs.jar) to my java project. 4???when i consume the gp service, a RemoteException occur.the error message is "the table name is invalid";
but when i run the tool in arcgis catalog, i works well and generated the right result. I can't find out the reason. Any body with any idea is appreciated.
code snip:(error ocurred at the last line)
String endpoint = "http://winson:8399/arcgis/services/IDWBox/GPServer?"; GPServerBindingStub gpserver = new GPServerBindingStub(new java.net.URL (endpoint), null); GPToolInfo gpti = gpserver.getToolInfo("IDW"); GPParameterInfo[] paramInfos = gpti.getParameterInfo(); //Set the input values for user defined points. // Create 6 input point feature to idw. GPFeatureRecordSetLayer gpfrs = (GPFeatureRecordSetLayer)paramInfos[0].getValue(); PointZ[] pt = GetPoints();//6 point created RecordSet rs = gpfrs.getRecordSet(); Fields flds = rs.getFields(); Record[] recs = new Record[pt.length]; for(int p=0;p<pt.length;p++){ Record rec = new Record(); PointN p1 = new PointN(); p1.setX(pt
.getX());
p1.setY(pt
.getY());
Object[] o = new Object[flds.getFieldArray().length]; for (int i = 0; i < flds.getFieldArray().length; i++) { if (flds.getFieldArray().getName().equals(gpfrs.getShapeFieldName())) { o = p1; } else if (flds.getFieldArray().getName().equals(gpfrs.getOIDFieldName())) { o = p+1; } else { EsriFieldType ftype = flds.getFieldArray().getType(); if (ftype == EsriFieldType.esriFieldTypeString) { o = ""; } else { o = pt
.getZ();
} } } rec.setValues(o); recs
= rec;
} gpfrs.getRecordSet().setRecords(recs); //Set input values in the same order listed by the geoprocessing service. GPValue[] gpvalues = new GPValue[1]; gpvalues[0] = gpfrs;