findTask = new FindTask("REMOVED HERE But Valid url used"); findTask.ExecuteCompleted += new EventHandler<FindEventArgs>(findTask_ExecuteCompleted); findTask.Failed += new EventHandler<TaskFailedEventArgs>(findTask_Failed); FindParameters findParameters = new FindParameters(); findParameters.LayerIds.AddRange(new int[] { 6, 8 }); //layer id for vejnavne findParameters.SearchFields.AddRange(new string[] { "VEJNAVN" }); findParameters.ReturnGeometry = true; findParameters.SearchText = autoCompleteAdresse.Text.ToUpper(); //debug data MyTextBlock.Text = findParameters.SearchFields[0].ToString() + " " + findParameters.SearchText + " " + findParameters.LayerIds.ToString() + findTask.Url; findTask.ExecuteAsync(findParameters);
When you perform Find from your web browser, do you use the same parameters that your application use? Can you verify that these parameters are correct and both app and browser yield to same result? Please refer to post#14 from this thread to guide you on what to look for when running Fiddler with your app http://forums.arcgis.com/threads/14730-Area-And-PerimeterAppending "&f=json" to the Url should not have caused this error. I tried the same here: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/find?searchText=Alabama&contains=true&searchFields=&sr=&layers=1&returnGeometry=true&f=pjson
https://gis.verdo.dk/ArcGIS/rest/services/GRUNDKORT/GrundkortRDS/MapServer//Find?searchText=Bøsbrovej&contains=true&returnGeometry=true&searchFields=VEJNAVN&layers=8&f=json&
.../Find?searchText=11086&contains=true&returnGeometry=true&searchFields=OBJECTID&layers=1&f=json&
{"error":{"code":500,"message":"Object reference not set to an instance of an object.","details":[]}}
# results: 1 59957S44858 Feature ID: -1 Field Name: Grid Number Layer: Pole
{"error":{"code":500,"message":"Object reference not set to an instance of an object.","details":[]}}.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.