public void Identify(MapPoint ptMapPoint) { //called from btnIdentify on the toolbar - runs an Identiy on all map layers IdentifyTask IDTask; IdentifyParameters idParams = new IdentifyParameters() { Geometry = ptMapPoint, MapExtent = _Map.Extent, Width = (int)_Map.ActualWidth, Height = (int)_Map.ActualHeight, LayerOption = LayerOption.all, SpatialReference = _Map.SpatialReference }; for (int i = 0; i < _Map.Layers.Count; i++) { if (!(_Map.Layers is GraphicsLayer)) { IDTask = new IdentifyTask(); IDTask.ExecuteCompleted += IdentifyTask_ExecuteCompleted; IDTask.Failed += IdentifyTask_Failed; IDTask.Url = MapUtils.GetLayerURL(_Map.Layers); IDTask.ExecuteAsync(idParams, i); } } } private void IdentifyTask_ExecuteCompleted(Object sender, IdentifyEventArgs args) { //simplified for debugging... if ((args.IdentifyResults != null) && (args.IdentifyResults.Count > 0)) { MessageBox.Show((sender as IdentifyTask).Url + " num results= " + args.IdentifyResults.Count); } else { MessageBox.Show((sender as IdentifyTask).Url + " has no ID results"); } } private void IdentifyTask_Failed(Object sender, TaskFailedEventArgs e) { MessageBox.Show("Identify failed. Error: " + e.Error.Message); }
Does the service URL in your identify task require a ProxyUrl?
When you sumbit an identify request to that URL is the browser prompting you for a username and password (just to make sure you have correct permission to the service)? How about the SL application you wrote? Does it also prompt for authentication when you clicked on the map?