Page 1 of 1

xTour - planBasicTour HTTP Error 403

Posted: Wed Jun 13, 2018 3:22 pm
by couplink-dev
Hello,

when sending a planBasicTours-Request to https://api-test.cloud.ptvgroup.com/xtour/ws/XTour the following exception is thrown:

"HTTP-Status 403: Forbidden - User could not be authorized. You can't run job-methods on api.cloud.ptvgroup.com. User tried to access features which are forbidden for this url and has an empty / unauthorized feature set.."

This can be recreated using the Raw Request Runner.

However, if I send my Request to https://xtour-eu-n-test.cloud.ptvgroup. ... r/ws/XTour I get my expected result.

Why do these two endpoints behave different?

Best Regards,

Tim

Re: xTour - planBasicTour HTTP Error 403

Posted: Wed Jun 13, 2018 3:56 pm
by Bernd Welter
Hello Tim,

the error message you faced is related to the different versions of so-called datacenter URL scheme. As you might know the server software is installed in Microsoft's AZURE cloud and some of the systems are clustered via several data centers.

Behind some xServers we use a job database (e.g. to enable users to monitor active optimization calls in case of asynchronous calls). In fact there's an individual job database behind each data center which means you need to ensure to send a succeeding call to the same datacenter as the "initial call". This is why we offer the qualification in the service URL. We call this the routed URL scheme:
RoutedUrl.png
  • Very important section describing the meaning of the datacenter url shemes: URL Shemes
  • If you use the "unqualified" service URL such as http://api.cloud.ptvgroup.com the AZURE load balancer determines the best datacenter (geographically close, not utilized,...).
  • If you use the "qualified" service URL such as http://api-eu.cloud.ptvgroup.com the load balancer redirects you to the corresponding data center.
Long story short: if you want to work with asynchronous calls (or with methods which use the job database) you have to use the qualified URL scheme.
This applies at least to
  • Tour.startPlanBasicTours / startPlanSequence / startPlanOvernightTours
  • xRoute.startCalculateMatrixInfo / startCalculateBulkRouteInfo
  • xLocate.startFindAddresses / startFindLocations / startFindPOIByAddresses / startFindPOIByLocations
Further info is available at http://xserver.ptvgroup.com/en-uk/cookb ... formation/
RoutedUrl2.png
Best regards,
Bernd