Page 1 of 1

XRoute2: Comparison REST to JSON/SOAP

Posted: Wed Dec 02, 2020 4:54 pm
by Bernd Welter
Hi there,

every once in a while I encounter the following issue and the intention of this post is to inform you about how to start a proper integration. As you may know the xRoute API offers different approaches to ask for a route:
I recommend to use JSON/SOAP interfaces which give you full access to all we can compute. The XRoute2 REST API is too limited!

Here's why.

All these approaches return an object of type RouteResponse which is based on a hierarchy with various elements such as
  • driving distance / driving period
  • various arrays
  • further complex objects
Most of them are labelled as "not mandatory" (required: no).

So what is not obvious for a newbie in these interfaces is "which elements are returned by my call?"
Here's a significant difference between the JSON/SOAP on the one hand and REST on the other hand:
  • With JSON/SOAP you can specify a ResultFields object which enables you to select potential response elements.
  • With the REST api you are forced to rely on the elements that are chosen by our design (only exception is the polygon line which can be selected through a URL parameter)
Now the thing is that important elements such as
  • Segments[]
  • Toll
  • Emissions
aren't returned by the REST API so this is usually a showstopper.

PS: Furthermore the REST API can only handle 2 waypoints at the time.