SOAP API 如何ApplyEdit featurelayer 没有globalID

经测试 用以下的code 可以实现update feature 通过SOAP的ApplyEdit,但问题是如果featureLayer 没有enable database的globalID就会得到 Error processing server request
 
我已经在geonet上帮助用户实现了有globalID的featureLayer ApplyEdit, 但如果没有globalID不知道如何处理,这是相关原文链接https://geonet.esri.com/thread/83696


namespace SOAP_Add
{
class Program
{
private static void Main(string argsy)
{
var featureURL = "https://sampleserver6.arcgison ... 3B%3B
var myFeatureService = new Recreation_FeatureServer { Url = featureURL };

PropertySetProperty inputfields = new PropertySetProperty[3];
PropertySetProperty property = new PropertySetProperty();
property.Key = "objectid";
property.Value = 370918;
inputfields.SetValue(property, 0);


property = new PropertySetProperty();
property.Key = "description";
property.Value = "SOAP TEST";
inputfields.SetValue(property, 1);

PropertySetProperty property3 = new PropertySetProperty();
property3.Key = "globalid";
property3.Value = "{648A27AA-DCBE-414D-8299-2A3EE0E4BDC1}";
inputfields.SetValue(property3, 2);

PropertySet pSet = new PropertySet();
pSet.PropertyArray = inputfields;

GraphicFeature gfeature = new GraphicFeature();
gfeature.Properties = pSet;

DataObject dataArray = new DataObject[1];
dataArray[0] = gfeature;

DataObjects dObjects = new DataObjects();
dObjects.DataObjectArray = dataArray;

TableEdit tableEdit = new TableEdit();
tableEdit.Updates = dObjects;
tableEdit.LayerOrTableID = 0;

TableEdit tableEdits = new TableEdit[1];
tableEdits.SetValue(tableEdit, 0);

try {
TableEditResult results = myFeatureService.ApplyEdits(tableEdits, "", true, true);
EditResult r = results[0].UpdateResults[0];
if (r.Succeeded) Console.WriteLine(r);
else Console.WriteLine(r.Description);
}
catch (Exception en)
{
Console.WriteLine(en.ToString());
}

}


}
}
已邀请:

要回复问题请先登录注册