POST
|
Forcing TLS 1.2 via System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12 and switching the project to .Net Framework 4.7 doesn't seem to help.
... View more
03-28-2019
07:30 AM
|
0
|
0
|
1384
|
POST
|
It does appear related to the authentication. I am using the code below. Private ArcGISOnineUser As String = "xxx" Private ArcGISOninePassword As String = "xxx" Public Sub New() Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.ClientId = "xxx" Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize() InitializeComponent() IdentityManager.Current.ChallengeHandler = New ChallengeHandler(AddressOf CreateHardCodedCredentialAsync) end sub Private Async Function CreateHardCodedCredentialAsync(requestInfo As CredentialRequestInfo) As Task(Of Credential) Dim cred As Credential = Nothing Try Dim options = New GenerateTokenOptions() options.TokenAuthenticationType = TokenAuthenticationType.ArcGISToken cred = Await IdentityManager.Current.GenerateCredentialAsync(requestInfo.ServiceUri, ArcGISOnineUser, ArcGISOninePassword, options) Catch webEx As ArcGISWebException ' couldn't generate a token, probably a bad login MessageBox.Show("Unable to log in to ArcGIS Online: " + webEx.Message) End Try Return cred End Function After some investigation it seems that GenerateCredentialAsync never seems to return anything and the task seems to run indefinitely. as a test it tried having it wait for the task completion Dim cred As Task(Of Credential) = CreateHardCodedCredentialAsync2("https://www.arcgis.com/sharing/rest") Try cred.Wait() Catch ex As Exception MsgBox(ex.Message) End Try In this case it would just be stuck on cred.Wait() forever CreateHardCodedCredentialAsync2 is just there to replace the requestInfo.ServiceUri I tried running the sample in https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/10.2.7/src/Desktop/ArcGISRuntimeSamplesDesktop/Samples/Security/OAuthAuthorization, but when i clicked sign in all it did is display a page saying Invalid redirect_uri Error: 400 i left the default private const string StandardAppDesktopRedirectUri = "urn:ietf:wg:oauth:2.0:oob"; as i don't have a landing page.and just filled in my client id.
... View more
03-27-2019
02:39 PM
|
0
|
2
|
1384
|
POST
|
I even tried using previous data that i used before for testing when it was working with the same issue. Here is the code Dim routeGraphics = TryCast(MyMap.Layers("RouteResults"), GraphicsLayer) If routeGraphics Is Nothing Then Throw New Exception("A graphics layer named 'RouteResults' was not found in the map.") End If Dim uri = New Uri("http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World") Dim routeTask = New OnlineRouteTask(uri) Dim RouteRestrictions = New List(Of String) RouteRestrictions.Add("Avoid Toll Roads") Dim routeParams = Await routeTask.GetDefaultParametersAsync() routeParams.OutSpatialReference = MyMapView.SpatialReference routeParams.DirectionsLengthUnit = LinearUnits.Miles routeParams.ReturnDirections = True routeParams.DirectionsLanguage = New CultureInfo("en-Us") routeParams.FindBestSequence = CBool(OptOptimized.IsChecked) routeParams.PreserveFirstStop = CBool(PreserveStopsCbx.IsChecked) routeParams.PreserveLastStop = CBool(PreserveStopsCbx.IsChecked) routeParams.UseHierarchy = Not CBool(CbxAvoidHwy.IsChecked) If (CbxAvoidToll.IsChecked) Then routeParams.RestrictionAttributeNames = RouteRestrictions End If routeParams.ReturnStops = True routeParams.SetStops(routeGraphics.Graphics) Dim routeResult = Await routeTask.SolveAsync(routeParams) It gives that error on the last line
... View more
03-19-2019
09:30 AM
|
0
|
4
|
1384
|
POST
|
I had written an application a few years ago using .net sdk 10.2.7. It was working fine a few years ago. i came back to trying to use it now,but when it try it now. it is giving an error of Value cannot be null. Parameter name: source when calling the Dim routeResult = Await routeTask.SolveAsync(routeParams) Was something changed in the API?
... View more
03-19-2019
08:34 AM
|
0
|
6
|
2215
|
Online Status |
Offline
|
Date Last Visited |
04-05-2021
11:00 AM
|