XRoute2: Comparison REST to JSON/SOAP

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2575
Joined: Mon Apr 14, 2014 10:28 am
Contact:

XRoute2: Comparison REST to JSON/SOAP

Post 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.
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply