I have an Silverlight application from which I'm trying to create new features to ArcGIS server. Every time I get error

{\"error\":{\"code\":400,\"message\":\"Unable to complete operation.\",\"details\":[\"Invalid parameters\"]}}

My request code is like this:

System.Net.WebClient client = new System.Net.WebClient(); client.Headers["Content-type"] = "application/x-www-form-urlencoded"; client.Encoding = System.Text.Encoding.UTF8; client.UploadStringCompleted += client_UploadStringCompleted;

client.UploadStringAsync(new Uri("http://.../FeatureServer/0/addFeatures?f=json&features"), "POST", JSONString);

If I copy the JSONString variable to a text editor, replace every escaped double quote mark (\") with double quote mark (") and use the ArcGIS servers /FeatureServer/0/addFeatures form, I am able to store the same features in that form to a featurelayer. That makes me thinking that the JSON data is well formed and valid for the featurelayer I'm using.

What could make the request response an error every time when called ArcGIS server from Silverlight application?


I followed the instructions below and found a solution. First, the endpoint URL is like /.../FeatureServer/0/addFeatures, not like /.../FeatureServer/0/addFeatures?f=json?features

features=[{"geometry":{"x":0,"y":0}, "attributes":{"Id":"018-00","SV":"","Num":"4 A"}}]&f=json

Found the solution from here and by comparing the POST methods made from my application and the web form with Fiddler

  • Any reason for constructing the request manually and not using FeatureLayer (help.arcgis.com/en/webapi/silverlight/help/index.html#//…) from the ESRI Silverlight API?
    – Petr Krebs
    Oct 2, 2012 at 16:25
  • Can we see the exact POST body? The url-encoded form will almost certainly not be identical to what you enter on the ArcGIS Server REST API page.
    – Petr Krebs
    Oct 2, 2012 at 16:27
  • For the first question: not really. I'll read the documentation again and see if I can use it. For the second question: I'll be check the POST body when I get back to it and see if I can provide some additional information from it.
    – Olli W
    Oct 2, 2012 at 16:55
  • 2
    Your POST request will need to include parameters as described in the documentation, that is f and features. These parameters will need to be in the proper url-encoded format, which is not the same as what you enter in the REST page form. In any case, I suggest you try the FeatureLayer class. You do not need to add it to the map as most samples suggest. You can then either keep on using it, or capture with Fiddler what the correct request sent by the FeatureLayer looks like.
    – Petr Krebs
    Oct 2, 2012 at 17:12
  • 1
    That is an entirely separate question. For batch data input, a different approach altogether would work best I think - use a geoprocessing service published on the server and call that from the Silverlight client, sending the file as a geoprocessing parameter. See An overview of geoprocessing with ArcGIS Server and Input and output data types.
    – Petr Krebs
    Oct 2, 2012 at 17:59

2 Answers 2


This is what a POST request to applyEdits looks like:

In the headers:


POST body:


which is the url-encoded form for these parameters:


I know you call addFeatures instead of applyEdits, but the principle is exactly the same.

Now, my guess is that your POST body is not url-encoded and is partial only, something like this perhaps:

  • For sure I was missing the "f=json" part of the post body since it was included in the url.
    – Olli W
    Oct 2, 2012 at 18:04
  • 1
    Only partially related, but with the javascript version, I had to JSON.stringify() the features part, but not the whole object - whole object throws an error. Spent a whole day bashing my head trying to figure out why.
    – Mgamerz
    Aug 24, 2015 at 23:50
  • @Mgamerz, I had the same problem (and even though I read your comment it didn't sink in :\\ ) - the issue is that nested objects may not be encoded correctly (or at all) depending on the library being used to encode.
    – ChidG
    Dec 13, 2016 at 13:50

Use Fiddler to capture the request that works and the request that doesn't work, then compare them.

You can compare with Fiddler if you also have WinMerge - just select the two requests, right-click, and select Compare.

I suspect that you will find an encoding difference or an additional parameter in the working request. You can also use the WebForms inspector within Fiddler to quickly determine the form parameters that were submitted with the request (regardless of GET or POST)

My hunch is that your Invalid Parameters are a result of the additional ?f=json&features URI parameters on the URI argument for UploadStringAsync. POST parameters are part of the request body, so you probably have two f and two features parameters on your request.

  • With Fiddler I was able to see the request made from Silverlight app. It seemed ok with all JSON data as it was constructed and posted in the app.
    – Olli W
    Oct 2, 2012 at 16:56
  • Did you compare the Silverlight-made request with the form request?
    – mwalker
    Oct 2, 2012 at 17:01
  • Not yet. I'll have a look on it
    – Olli W
    Oct 2, 2012 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.