AnsweredAssumed Answered

Error in Solving Route

Question asked by abhinav.tummala on Jan 17, 2020
Latest reply on Feb 3, 2020 by Abhinav_Tummala

Michael Branscomb



I'm writing a mobile Xamarin Android app that uses a network analysis service (NAS) to find routes.
This is my work environment:

Windows 7 Pro

Visual Studio 2019 Professional

ArcGIS Runtime SDK 100.7

ArcGIS Server 10.7.1


The NAS uri is Route (NAServer) 

This Routing Service has no GTFS, just the street routing information.


To create a route task and solve it, I use this code:


RouteTask solveRouteTask = await RouteTask.CreateAsync(_routeServiceUri);

// Get the default parameters from the route task (defined with the service)
RouteParameters routeParams = await solveRouteTask.CreateDefaultParametersAsync();

// Make some changes to the default parameters
routeParams.ReturnStops = true;
routeParams.ReturnDirections = true;

// Set the list of route stops that were defined at startup

// Solve for the best route between the stops and store the result
RouteResult solveRouteResult = await solveRouteTask.SolveRouteAsync(routeParams);

// Get the first (should be only) route from the result
Route firstRoute = solveRouteResult.Routes.First();

// Get the route geometry (polyline)
Polyline routePolyline = firstRoute.RouteGeometry;

// Create a thick purple line symbol for the route
SimpleLineSymbol routeSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Colors.Purple, 8.0);

// Create a new graphic for the route geometry and add it to the graphics overlay
Graphic routeGraphic = new Graphic(routePolyline, routeSymbol);

// Get a list of directions for the route and display it in the list box
DirectionsListBox.ItemsSource = firstRoute.DirectionManeuvers.Select(direction => direction.DirectionText);


Route Stop Parameters:

MapPoint fromPoint = (MapPoint)GeometryEngine.Project(currentLoc, new SpatialReference(2247));
MapPoint toPoint = (MapPoint)GeometryEngine.Project(tappedpoint, new SpatialReference(2247));


From and To Points are in Stateplane.


I am getting the below exception at :

await solveRouteTask.SolveRouteAsync(routeParams);





{Esri.ArcGISRuntime.Http.ArcGISWebException: Unable to complete operation.
at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler+ArcGISClientHandlerInternal.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00a1a] in <fe6820dba09a468695234a822154bd83>:0
at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered (System.Threading.Tasks.Task`1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) [0x000b3] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:531
at Esri.ArcGISRuntime.ArcGISException.HandleCoreError (RuntimeCoreNet.GeneratedWrappers.CoreError error, System.Boolean throwException) [0x00013] in <fe6820dba09a468695234a822154bd83>:0
at RuntimeCoreNet.GeneratedWrappers.Interop.CheckError (System.IntPtr errorHandle, System.Boolean throwOnFailure, System.Runtime.InteropServices.GCHandle wrapperHandle) [0x0002e] in <fe6820dba09a468695234a822154bd83>:0
at RuntimeCoreNet.GeneratedWrappers.CoreTask.Get () [0x00019] in <fe6820dba09a468695234a822154bd83>:0
at Esri.ArcGISRuntime.Internal.CoreTaskExtensions+TaskCompletedCallbackHandler`1[T].OnCompleted (System.Object sender, System.EventArgs e) [0x00034] in <fe6820dba09a468695234a822154bd83>:0
--- End of stack trace from previous location where exception was thrown ---

at Esri.ArcGISRuntime.Internal.CoreTaskExtensions+TaskCompletedCallbackHandler`1[T].CreateInternal (RuntimeCoreNet.GeneratedWrappers.CoreTask task, System.Threading.CancellationToken cancellationToken) [0x0007f] in <fe6820dba09a468695234a822154bd83>:0


Network Analyst