Select to view content in your preferred language

Exception on ReturnDirections Server 10.1

2133
2
Jump to solution
09-18-2012 04:40 AM
JustinHunter
Regular Contributor
When I enable ReturnDirections I get the following exception:

[PHP]System.ArgumentException was caught
  Message=Number contains invalid characters.
  Source=ESRI.ArcGIS.Client
  StackTrace:
       at ESRI.ArcGIS.Client.Tasks.RouteTask.ConvertBase32(String base32number)
       at ESRI.ArcGIS.Client.Tasks.RouteTask.decompressGeometry(String compressedGeometry, PointCollection points)
       at ESRI.ArcGIS.Client.Tasks.RouteTask.decodeFeatures(IList`1 features, PointCollection path, GeometryType geomType)
       at ESRI.ArcGIS.Client.Tasks.RouteTask.decodeDirectionsFeatures(IDictionary`2 direction)
       at ESRI.ArcGIS.Client.Tasks.RouteTask.DeserializeRouteResults(String result, Object userToken)
       at ESRI.ArcGIS.Client.Tasks.RouteTask.Solve(RouteParameters parameters)
       at my class and whatnot:line 157
  InnerException:
[/PHP]

I can only assume that the < 0.1 that it returns is causing the error when trying to convert it to a number, but I cannot be certain.

Any ideas? Returning directions is absolutely mandatory.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MattCrowder
Esri Contributor
This may be because it's trying to return a newer representation of the compressed geometry than the your route task knows how to deal with.  The server can return the older format if the output routes don't include Zs or Ms.  Does your network have Zs.  If not, is it trying to return Ms?  You can try explicitly setting the routeTask.outputLines = TRUE_SHAPE so it doesn't return measures.  Is it possible for you to run fiddler or something to intercept what the route service is returning?

Matt

View solution in original post

0 Kudos
2 Replies
MattCrowder
Esri Contributor
This may be because it's trying to return a newer representation of the compressed geometry than the your route task knows how to deal with.  The server can return the older format if the output routes don't include Zs or Ms.  Does your network have Zs.  If not, is it trying to return Ms?  You can try explicitly setting the routeTask.outputLines = TRUE_SHAPE so it doesn't return measures.  Is it possible for you to run fiddler or something to intercept what the route service is returning?

Matt
0 Kudos
JustinHunter
Regular Contributor
This may be because it's trying to return a newer representation of the compressed geometry than the your route task knows how to deal with.  The server can return the older format if the output routes don't include Zs or Ms.  Does your network have Zs.  If not, is it trying to return Ms?  You can try explicitly setting the routeTask.outputLines = TRUE_SHAPE so it doesn't return measures.  Is it possible for you to run fiddler or something to intercept what the route service is returning?

Matt


My network does have Zs and adding the following did the trick. 🙂
[PHP]parameters.OutputLines = "esriNAOutputLineTrueShape"; [/PHP]

Thanks Matt!
0 Kudos