We are trying to add points to our own AGS V10 feature server using REST in C#. Using the HTML form I can submit the same JSON feature that I am POSTing in code and it is successful. I don't know what is wrong with my parameters since there are no published examples for this 😞 😞Was hoping to have this working for a webex today at 2:00 eastern so I can get an OK to go forward on using Feature Services.Thanks!here is my code: public void AddNewFeature(string aJSONString)
{
string aUrl = string.Format("{0}/{1}", _url.AbsoluteUri, "addFeatures?f=json&features");
Uri aUri = new Uri(aUrl);
string aRespStr = "";
using (WebClient client = new WebClient())
{
client.Headers["Content-type"] = "application/json";
client.Encoding = Encoding.UTF8;
aRespStr = client.UploadString(aUri, aJSONString);
//aRespStr = client.UploadString(aUri, HttpUtility.UrlEncode(aJSONString));
}
}
Here is the JSON feature I am posting:[{"geometry":{"x":-9107536.44005102,"y":3321905.0880102},"attributes":{"HOUSE_NO":"123456","ST_NAME":"WillTest","COMMENTS":"IslandHouse"}}]Fiddler info re: request:POST http://vmgsc/ArcGIS/rest/services/LeesburgFL_FeatureServiceTest/FeatureServer/0/addFeatures?f=json&f... HTTP/1.1Content-Type: application/jsonHost: vmgscContent-Length: 79Expect: 100-continue[{"geometry":{"x":403778.3,"y":1604409},"attributes":{"HOUSE_NO":"555666777"}}]Fiddler info re: Response:HTTP/1.1 200 OKContent-Type: text/plain;charset=utf-8Server: Microsoft-IIS/7.0X-Powered-By: ASP.NETDate: Mon, 14 Jun 2010 13:55:16 GMTContent-Length: 98{"error":{"code":400,"message":"Unable to complete operation.","details":["Invalid parameters"]}}