Noah,There's not much to it. Here is the web page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestSaveDelete.aspx.vb" Inherits="HilandWeb.TestSaveDelete" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Save and Delete Functions</title>
<script src="Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="http://js.arcgis.com/3.7/" type="text/javascript"></script>
<script type="text/javascript">
var ROWLayer;
var q;
require([
"esri/config",
"esri/layers/FeatureLayer",
"esri/geometry",
"esri/tasks/query",
"dojo/domReady!"
], function (
esriConfig,
FeatureLayer,
Geometry,
Query
) {
esriConfig.defaults.io.proxyUrl = "proxy.ashx";
esriConfig.defaults.io.alwaysUseProxy = true;
ROWLayer = new FeatureLayer("http://thegisserver/arcgis/rest/services/Hiland/ROW/MapServer/0",
{ outFields: ["*"] });
q = new Query();
});
function update() {
q.objectIds = [2395];
ROWLayer.queryFeatures(q, function (featureSet) {
if (featureSet.features.length == 1) {
var thisFeature = featureSet.features[0];
thisFeature.attributes.ContactName = 'Jake Lowther';
ROWLayer.applyEdits(null, [thisFeature], null);
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="javascript:update();" />
</div>
</form>
</body>
</html>
I'm using the proxy.ashx provided by ESRI. My config looks like this:<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig mustMatch="false">
<serverUrls>
<serverUrl url="http://thegisserver/arcgis/rest/services/"
matchAll="true" token="FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h "></serverUrl>
</serverUrls>
</ProxyConfig>
When the page loads there is a successful call to the layer to establish the FeatureLayer (everything in the query string):GET /arcgis/rest/services/Hiland/ROW/MapServer/0?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback&token=FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h HTTP/1.1When the button is clicked the first call (queryFeatures) is successful (everything in the query string):GET /arcgis/rest/services/Hiland/ROW/MapServer/0/query?f=json&returnGeometry=true&spatialRel=esriSpatialRelIntersects&objectIds=2395&outFields=*&callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback&token=FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h HTTP/1.1The the applyEdits call looks like this (token in the query string, f and updates in the body):POST /arcgis/rest/services/Hiland/ROW/MapServer/0/applyEdits?token=FykBFF29p8_4Gt2nTw57Eh2G_yows8koT--8Z7Q__34cf6gQQDwGp1H59EZrBc1h HTTP/1.1But the result of the applyEdits is shown below (clearly not an applyEdits result...):[ATTACH=CONFIG]30505[/ATTACH]I believe that if you attempted to applyEdits to any secured FeatureLayer via the proxy using a token you would see similar results.Can you confirm?Thanks again,Dave