XRoute2: Comparison REST to JSON/SOAP
Posted: Wed Dec 02, 2020 4:54 pm
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:
Here's why.
All these approaches return an object of type RouteResponse which is based on a hierarchy with various elements such as
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:
PS: Furthermore the REST API can only handle 2 waypoints at the time.
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:
- JSON / SOAP (documentation)
- REST (documentation)
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
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)
- Segments[]
- Toll
- Emissions
PS: Furthermore the REST API can only handle 2 waypoints at the time.