psiclopz

Routing with Local Data

Discussion created by psiclopz on Aug 24, 2011
Latest reply on May 11, 2012 by geddylee74
I want to do routing with local data instead of using a web service.  I've created my Network dataset and route layer successfully.  I exported it as a Map Pack and tried using that in the

_routeTask = new RouteTask("D:\\MyRoute.mpk");

line and then when I tried to run the

_routeTask.SolveAsync

command it returns failed with the error:
"An exception occurred during a WebClient request."
with an internal exception of:
"Unable to cast object of type 'System.Net.FileWebRequest' to type 'System.Net.HttpWebRequest'."

So obviously it's expecting a URL and not a filepath in the constructor of the RouteTask, which is interesting since the FindTask and the Locator both accept filepaths. 

What am I doing wrong here?  Did I go wrong with exporting as a map pack?

Thanks,

James

Outcomes