Page 1 of 1

Why does the tourid change?

Posted: Fri Jan 05, 2018 9:37 am
by CB*
Hi!

I am calculating a input tour with the following parameters:

<Tour ... id="9900005157" tourPointFixation="NO_TOUR_POINT_OUT" ...

In the result i am getting

<ns4:Tour ... id="1310070565" ...

When the tour is fixed, I would expect to get the same id back in a successful request .

You can find my request attached.
I am using xTour 1.24.0.1.

Thanks
CB*

Re: Why does the tourid change?

Posted: Fri Jan 05, 2018 11:48 am
by Joost
I took a quick look, looks like your tourId is bigger then a regular integer can be and there is an internal overflow.

9900005157 mod 2147483647 = 1310070565

Are you working with SAP by any chance? I had a similar issue some time ago where the integers from our interface where mapped against int8 instead of i type in SAP.

Re: Why does the tourid change?

Posted: Fri Jan 05, 2018 1:06 pm
by Bernd Welter
Looks like this topic hits both TourIDs and OrderIDs.
Long story short: as Joost explained it is caused by buffer overflow of the integers and produces an exception (Order ID) or a "replacement" (TourID).

For those (SAP based) users who ran into the issue: you need a mapping between your IDs (however they aber based) and some valid INTs.

The xTour2 API deals with string based IDs instead of INTs, so the problem won't occur anymore.

Besr regards,
Bernd

PS: your depot has more than 1000 intervals covering a period of 3.4 years. A bit weird if you ask me ;-)