AnsweredAssumed Answered

RouteTask returning server error

Question asked by jursachr_washco on Oct 29, 2015
Latest reply on Nov 2, 2015 by jursachr_washco



I am attempting to solve a RouteTask but I am receiving an error, which I cannot solve.


//create new feature set                        
var myFeatures = [];

//prepare parameters
var myRouteParams = new RouteParameters();
myRouteParams.stops = myFeatures;
myRouteParams.returnRoutes = true;                       
myRouteParams.returnDirections = true;
myRouteParams.outSpatialReference = new SpatialReference({ wkid:4326 });

//perform route between addresses  
var myRouteTask = new RouteTask("");       
//begin route task event handler
myRouteTask.on("solve-complete", function(myRouteTaskEvent)
 //get route result
 var myRouteResult = myRouteTaskEvent.routeResults;; 
});  //end route task event handler  

I am getting the following errors. 

SEC7120: Origin not found in Access-Control-Allow-Origin header.
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.


According to, I can ignore the first error.  However, I don't know about the second.


I am not receiving a result and the "solve complete " event is not being fired.


What am I doing wrong?