Select to view content in your preferred language

applyEdits Failing – HTML Response Instead of JSON (ArcGIS Server 10.4, ArcGIS JS API 4.x)

234
0
05-19-2025 01:14 AM
alabanu
Emerging Contributor

Hello,

I’m encountering an issue with the applyEdits operation on a Feature Service in ArcGIS Server 10.4, accessed via the ArcGIS API for JavaScript 4.x. 

When making an applyEdits request to the Feature Service, instead of receiving the expected JSON response, I get an HTML page with an error embedded in it. This causes the JavaScript API to throw a parsing error.

URL: FeatureServer/0/applyEdits

const response = await this.featureLayer.queryFeatures(query);
for (const item of response.features) {
const geometry = new Point(item.geometry);
    const graphic = new Graphic({
    geometry,
    attributes: attr
     });
features.push(graphic);
}
this.featureLayer.applyEdits(edits, options).then(function(results) {
  }).catch(function(error) {
   console.error("Error applying edits:", error);
});

const edits = {
    addFeatures:null,
    deleteFeatures: null,
    updateFeatures: features
};
                
const options = {
    globalIdUsed: false,
    rollbackOnFailureEnabled: false
};

 

Important note:

This call is not made manually — it's triggered by the API's  applyedits function.

 The Feature Service is accessed via a proxy, which works fine for other requests (e.g., query)

The same service and code work perfectly with ArcGIS JavaScript API 3.x, including applyedits.

Tags (1)
0 Kudos
0 Replies