xTour - planBasicTour HTTP Error 403

Proper forum for all questions related to xServer INTERNET = the Azure based cloud solution. This forum deals with the architecture topics such as load balancing, available profiles and standard server settings.
Please be aware that questions about core functionality such as routing, mapping, geocoding in general should be placed in the xServers dedicated forum ;-)
Post Reply
couplink-dev
Posts: 2
Joined: Wed Jun 13, 2018 2:58 pm

xTour - planBasicTour HTTP Error 403

Post 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
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: xTour - planBasicTour HTTP Error 403

Post 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
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