thank you for the speey reply
the odd thing is that a URL (http://services.arcgis.com/pmcEyn9tLWCoX7Dm/ArcGIS/rest/services/TimeZoneFeatures/FeatureServer/0) has either been changed or the security protocol has changed so I need to update the http with https yet when I change the URL in code and step through the code the URL does not reflect the new https but retains the http....frustrating.
You can use https, is this for token-secured service? QueryTask, like the other tasks have a Token property if you want to set this explicitly. Or you can also enable IdentityManager with SignInDialog or your own control that lets you set username/password for the secured service.
To use IdentityManager and SignInDialog, you can refer to the Security samples here: ArcGIS API for Silverlight - Interactive Samples | ArcGIS for Developers (should be similar to WPF).
Or if you have a token string, set QueryTask.Token property. If you have to go through a proxy, there's also ProxyUrl.
This doc might help : ArcGIS Runtime SDK for WPF
would anyone know, is the querytask used only for http URLs or can I use it with a https URL?
Does query need to be complicated?
Do both QueryTask point to the same service URL?
Have you tried sampleserver or is it service-specific perhaps?
var query = new Query() { Where = "1=1", ReturnGeometry = true }; query.OutFields.Add("*"); var firstQT = new QueryTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"); firstQT.Failed += (s, e) => { System.Diagnostics.Debug.WriteLine("firstQT.Failed"); }; firstQT.ExecuteCompleted += (s, e) => { System.Diagnostics.Debug.WriteLine("firstQT.ExecuteCompleted"); }; var secondQT = new QueryTask("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"); secondQT.Failed += (s, e) => { System.Diagnostics.Debug.WriteLine("secondQT.Failed"); }; secondQT.ExecuteCompleted += (s, e) => { System.Diagnostics.Debug.WriteLine("secondQT.ExecuteCompleted"); }; firstQT.ExecuteAsync(query); secondQT.ExecuteAsync(query);
Query query = new Query(); //Setup query here... QueryTask queryTask = new QueryTask(Url); queryTask.ExecuteAsync(query); QueryTask queryTask2 = new QueryTask(Url); queryTask2.Execute(query); //This one always times out after a minute or so
You can call the following method: http://help.arcgis.com/en/webapi/wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.TaskBase~CancelAsync.html if (queryTask.IsBusy) queryTask.CancelAsync(); queryTask.ExecuteAsync(query);
if (queryTask.IsBusy) queryTask.CancelAsync(); queryTask.ExecuteAsync(query);
Hi,Is there a document on how to cancel an excuting QueryTask properly?I know that there is method CancelAsync(), but I want to know more if additional steps need to be done to have this done properly.Thanks!
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.