AnsweredAssumed Answered

IDW Geoprocessing service can't execute

Question asked by laimosi on May 10, 2012
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[p].getX());
p1.setY(pt[p].getY());
Object[] o = new Object[flds.getFieldArray().length];
for (int i = 0; i < flds.getFieldArray().length; i++)
    {
        if (flds.getFieldArray()[i].getName().equals(gpfrs.getShapeFieldName()))
        {
            o[i] = p1;
        }
        else if (flds.getFieldArray()[i].getName().equals(gpfrs.getOIDFieldName()))
        {
            o[i] = p+1;
        }
        else
        {
            EsriFieldType ftype = flds.getFieldArray()[i].getType();
            if (ftype == EsriFieldType.esriFieldTypeString)
            {
                o[i] = "";
            }
            else
            {
                o[i] = pt[p].getZ();
            }
        }
    }
    rec.setValues(o);
    recs[p] = 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;

   GPResultOptions gpro = null;
  
   GPResult result = gpserver.execute(gpti.getName(), gpvalues, gpro);//error ocurred.

Outcomes