timeWindow and timeOffset limits

106 views
Skip to first unread message

Scott Pritchard

unread,
Dec 28, 2018, 1:51:12 AM12/28/18
to A gathering place for the Open Rail Data community
I'm fairly new to working with the LDB API so please excuse me if I've overlooked something.

I've managed to connect to it successfully and retrieve data using the https://github.com/mattsalt/national-rail-darwin package. I'm experienced with node, but I'm finding that I'm only able to use a timeWindow of 120 or less, and timeOffset needs to be less than 120 (otherwise the API returns an error). I've tried hardcoding the values within the package itself, firstly to verify it was possible to set custom values that way (it is) but secondly to see if it was possible to set values beyond those previously stated. Values for timeWindow at 120 or below adjust the response as appropriate, but values above 120 have no effect. Values for timeOffset below 120 likewise affect the response, but set it to 120 or above and the API returns an error.

I've had a look through the documentation, but it's fragmented, with old data samples and no solid examples based on recent data schemas (for example, I couldn't even figure out what the SOAPHeader needed to be set to when trying to query via Postman and simply couldn't get anything better than an error). SOAP API's aren't something I'm familiar with as it was fading out in favour of JSON (and even just regular XML in response to regular GET with querystring params) long before I started coding.

Is there any way to retrieve services beyond the 120 minute window and to set an offset? Both values are listed as INT in the package, so I'd assume that there's no trickery involved such as prepending + to it.

Thomas Wood

unread,
Dec 28, 2018, 9:39:47 AM12/28/18
to Scott Pritchard, A gathering place for the Open Rail Data community
timeOffsets and timeWindows are documented as being between 120 and -120 here: http://lite.realtime.nationalrail.co.uk/openldbsvws/

--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To post to this group, send email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rail Ale Fan

unread,
Dec 29, 2018, 8:59:21 AM12/29/18
to A gathering place for the Open Rail Data community
Hi Scott,

To go beyond 2 hours you need to use OpenLDBSVWS;


(or Push Port of course, but that is a lot more work)

However, it looks like the documentation at http://lite.realtime.nationalrail.co.uk/openldbsvws/ is incorrect for some of the methods as OpenLDBSVWS works on a time + timeWindow basis rather than timeOffset + timeWindow - the best reference for OpenLDBSVWS is the LDB-SV User Guide which is on the wiki;


Cheers

Thomas Wood

unread,
Dec 29, 2018, 4:20:43 PM12/29/18
to Rail Ale Fan, A gathering place for the Open Rail Data community
The staff version seems to use a mixture of timeOffset + timeWindow and time + timeWindow based of the age of the particular method called, for example GetArrivalDepartureBoardByCRS is one such method that is able to provide a longer timeWindow.

--

Rail Ale Fan

unread,
Dec 29, 2018, 5:01:02 PM12/29/18
to A gathering place for the Open Rail Data community
Hi Thomas,

None of the Staff Version methods use timeOffset, the documentation is incorrect.  Check the main service WSDL if you are not sure;


Cheers
Reply all
Reply to author
Forward
0 new messages