Select to view content in your preferred language

esriJobFailed Error on a simple GP Service

1198
1
07-18-2011 12:43 PM
S_Ector
Emerging Contributor
I am having trouble getting even the most simple GP service to work when accessing via the browser/javascript apis.  I'm on my 3rd GP Service test (now the simplest) and always get the same error.

I created a "BufferPoint" GP service following the tutorial at http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/GP_service_st...

I can successfully test the "submitJob" operation of the GP Service by putting the data into the form at the REST service url http://myserver/ArcGIS/rest/services/test/test/GPServer/BufferPoint/submitJob
like this:

Value for Point (GPFeatureRecordSetLayer):
{ 
"geometryType" : "esriGeometryPoint",
"spatialReference" : {"wkid" : 3857},
"features"  : [
{
    "geometry" : {"x" : -13087726.5, "y" : 6444025.3},
    "attributes" : {"Id" : 43, "Name" : "Feature 1"}
}
]
}


Value for Distance (GPLinearUnit):

{"distance" : 3000, "units" : "esriMeters"}


The javascript was taken directly from the samples:

gp = new esri.tasks.Geoprocessor("http://myserver/ArcGIS/rest/services/test/test/GPServer/BufferPoint");
gp.setOutSpatialReference({wkid:3875});

var graphic = new esri.Graphic(evt.mapPoint,pointSymbol);

var features= [];
features.push(graphic);

var featureSet = new esri.tasks.FeatureSet();
featureSet.features = features;

var buffDistance = new esri.tasks.LinearUnit();
buffDistance.distance = 3000;
buffDistance.units = "esriMeters";
var params = { "Point":featureSet, "Distance":buffDistance };
gp.submitJob(params, drawBuffer, statusCallback,function(error){
              alert(error);
});
    


I also tried hand coding the JSON definition I used in the REST service test and get the same error:

var featureJSON = { 
   "geometryType" : "esriGeometryPoint",
   "spatialReference" : {"wkid" : 3857},
   "features"  : [
    {
               "geometry" : {"x" : -13087726.5, "y" : 6444025.3},
               "attributes" : {"Id" : 43, "Name" : "Feature 1"}
    }
   ]
  };
var featureSet = new esri.tasks.FeatureSet(featureJSON);

[...]



Any ideas on what I need to do to find the reason for the error?

Thanks!
0 Kudos
1 Reply
S_Ector
Emerging Contributor
It turns out I transposed the last 2 numbers in the wkid in the javascript:
gp.setOutSpatialReference({wkid:3875});


Too bad esri does not give error codes other than just "Fail"!!
0 Kudos