3 Replies Latest reply on Feb 9, 2014 10:52 PM by MBranscomb-esristaff

    Route Task Error

    hen01@co.henrico.va.us
      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

                      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?