retrieveDefaultRouteTaskParameters fails

2723
4
05-19-2012 04:48 AM
MohammedSayed
New Contributor
hello,

I'm using the RoutingSample project, it's working with the default map in the project and I can get the routes between the point.
the problem is when I read my own map, it fails on this code:
[PHP]
[self.routeTask retrieveDefaultRouteTaskParameters];
[/PHP]

an alert view show this error at the very beginning:
Failed to retrieve default route parameters

the alert is in this function:
[PHP]
- (void)routeTask:(AGSRouteTask *)routeTask operation:(NSOperation *)op didFailToRetrieveDefaultRouteTaskParametersWithError:(NSError *)error {

// Create an alert to let the user know the retrieval failed
// Click Retry to attempt to retrieve the defaults again
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Error"
             message:@"Failed to retrieve default route parameters"
            delegate:self
            cancelButtonTitle:@"Ok" otherButtonTitles:@"Retry",nil];
[av show];
[av release];
}
[/PHP]

so, how can I solve this problem ? if I want to set the parameters manually.. what the parameters should I write?

thanks
0 Kudos
4 Replies
NimeshJarecha
Esri Regular Contributor
If you want to set your own parameters then comment out code line which executes retrieveDefaultRouteTaskParameters of AGSRouteTask. Then set your own AGSRouteTaskParameters and execute solveWithParameters method on AGSRouteTask.

You can check your default parameters of service on the REST end point. Do you see anything unusual? or Are you able to solve route on REST end point?

Regards,
Nimesh
0 Kudos
MohammedSayed
New Contributor
thanks for your reply nrjarecha,
I tried to set the parameters manually but with no luck, the rout is not working on my map on localhost. but it worked on this sample server : http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Route and I can find routes in my application.

I also tried to "Solve Route" on my localhost server itself, I set two stops, but it said the two stops are invalid or not defined, something like this. the route is working well on ArcMap, but when published on server, it's not. is there some parameters missing ? or may be there's some parameters should be defined for my country (Kuwait) ?

thanks
0 Kudos
lynnwang
New Contributor II
I met this problem a few days before that I can't retrieveDefaultRouteTaskParameters. Then I install arcgis server sp4, it turns be OK. You can have a try.
0 Kudos
NimeshJarecha
Esri Regular Contributor
Mohammed,

There is something wrong in your data/service. Please investigate that.

Regards,
Nimesh
0 Kudos