vsriram_i

World route service for Android not returning results

Discussion created by vsriram_i on Apr 17, 2013
Latest reply on Apr 25, 2013 by vsriram_i
Hi,
Iam using the arcGIS Android SDK v10.1.1. I want to plot the route between 2 points in the European region. Iam using the World Route service (as per http://blogs.esri.com/esri/arcgis/2013/04/08/legacy-geocoding-and-routing-services-at-httptasks-arcgisonline-com-will-be-retired-on-december-31-2013/) to get route info. But the server does not respond (nor times out) when solve is called.
Following is a snippet:


RoutingParameters routeParams = new RoutingParameters();
routeParams.setImpedanceAttributeName("Length");
String routeTaskURL = "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World";

//Prepare user credentials
UserCredentials userCredentials = new UserCredentials();
userCredentials.setAuthenticationType(AuthenticationType.TOKEN);
userCredentials.setSSLRequired(false);
userCredentials.setUserAccount(<userName>, <psswd>);
userCredentials.setUserToken(<user_token>, <referer>);


RoutingTask routeTask = new RoutingTask(routeTaskURL, userCredentials);

Point point1 = (Point) GeometryEngine.project(p1, mOutSpacialRef, mMap.getSpatialReference());//Spatial reference 4326
StopGraphic startPnt = new StopGraphic(point1);

Point point2 = (Point) GeometryEngine.project(p2, mOutSpacialRef, mMap.getSpatialReference());
StopGraphic endPnt = new StopGraphic(point2);

naFeatures.setFeatures(new Graphic[] { startPnt, endPnt });

NAFeaturesAsFeature naFeatures = new NAFeaturesAsFeature();
naFeatures.setSpatialReference(mMap.getSpatialReference());
naFeatures.setCompressedRequest(true);
routeParams.setStops(naFeatures);
routeParams.setOutSpatialReference(mOutSpacialRef);
try
{
  mResults = routeTask.solve(routeParams);//hangs here. no response and no timeout
} catch (Exception e)
{
  e.printStackTrace();
  return null;
}

The app hangs after calling solve, meaning there's no response from the server and hence waits forever. Can anyone please point out the mistake?


Thanks,
V. Sriram

Outcomes