Select to view content in your preferred language

Problem with the Silverlight Find task

1734
11
11-03-2010 01:42 AM
JacobSaugmann
Deactivated User
I've followed the instuctions from this : http://help.arcgis.com/en/webapi/silverlight/2.1/help/Find_task.htm

But every time i clik the Find button i get this error:
Find error: ESRI.ArcGIS.Client.Tasks.ServiceException: Object not set to an instance of an object.

my c# code from the click event:
 
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);


Any idea whats is Wrong?
0 Kudos
11 Replies
DaiDai1
Deactivated User
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-Perimeter

Appending "&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/Map...


HELP!
{
  "error" :
  {
    "code" : 500,
    "message" : "Object reference not set to an instance of an object.",
    "details" : []
  }
}
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Could you share the Url of the request returning this error? This might give a clue.

Thanks
0 Kudos