+ Reply to Thread
Results 1 to 4 of 4

Thread: Route Task Error

  1. #1
    Brian Hennessey
    Join Date
    Jan 2012
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Route Task Error

    I receive
    "Unable to complete operation., Unable to find attribute . Invalid context."

    when calling the NA servers' Route. Here is the code that I'm using to call the service

    Code:
                    RouteTask routeTask = new RouteTask("http://{ourInternalServer}/arcgis/rest/services/wm_Closest_Facility/NAServer/Route");
                    
                    // create the stop collection
                    GraphicsLayer startEndPoints = new GraphicsLayer();
                    Graphic testG = new Graphic();
                    testG.Geometry = new MapPoint(-8639323.8133,4529937.4133, new SpatialReference(WEB_MERC_SPATIAL_REF));
                    testG.Symbol =LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
    
                    startEndPoints.Graphics.Add(testG);
                    
                    Graphic endG = new Graphic()
                    {
                        Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol,
                        Geometry = endPoint
                    };
                    startEndPoints.Graphics.Add(endG);
                    RouteParameters routeParameters = new RouteParameters()
                    {
                        Stops = startEndPoints,
                        ReturnDirections = true,
                        OutSpatialReference = new SpatialReference(WEB_MERC_SPATIAL_REF),
                    };
    
    
                    routeTask.Failed += (source, args) =>
                    {
                        string errorMessage = "";
                        try
                        {
                            errorMessage += args.Error.Message;
                            foreach (string detail in (args.Error as ServiceException).Details)
                            {
                                errorMessage += "," + detail;
                            }
                        }
                        catch (Exception e)
                        {
                            errorMessage += ", no details.";
                        }
                        tbInfo.Text = "Route failed: " + errorMessage;
                        CloseSidebar();
                    };
    
    
                    routeTask.SolveCompleted += (source, args) =>
                    {
                        // Get the route and apply a symbol to it
                          --never gets here
    the endPoint is a valid MapPoint that was just plotted on the map. I'm using Runtime 10.1.1 and calling a 10.1 service. Any ideas? Or how to track down this error?

  2. #2
    houda houda
    Join Date
    Apr 2013
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: Route Task Error

    I have made a model using model builder like described here , then i published the model on arcgis server, before calling it using silverlight, it's working
    Last edited by MGeomak; 04-04-2013 at 06:15 AM.

  3. #3
    Joshua Vickrey
    Join Date
    Apr 2010
    Posts
    239
    Points
    0
    Answers Provided
    0


    0

    Default Re: Route Task Error

    Brian,

    Did you ever have any luck with this? I have the same problem. I have multiple routes that work perfectly fine in ArcMap but in using the routing service I created, I'm getting this error on all my routes but one.

  4. #4
    Mike Branscomb

    Join Date
    Feb 2010
    Posts
    882
    Points
    359
    Answers Provided
    59


    0

    Default Re: Route Task Error

    Hi,

    This error is coming directly from the NAServer, therefore it's failing to solve the route because one or more route parameters are invalid. Perhaps you are misspelling an attribute or missing an attribute that might be mandatory?

    Take a look at the end point for your service (e.g. http://sampleserver6.arcgisonline.co...NAServer/Route) and check everything looks ok.

    You could try running Fiddler, catching the request that is being submitted from the API to your server and take a look at that. Then check against the service and the doc: http://resources.arcgis.com/en/help/...l?nasolve.html.

    Cheers

    Mike
    ArcGIS Runtime Product Engineer

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts