how to get historical departure time from OpenLDBSVWS

264 views
Skip to first unread message

Wei Wang

unread,
Jun 9, 2020, 3:29:05 AM6/9/20
to A gathering place for the Open Rail Data community
Hi, all

I am wonddering how the API works for the OpenLDBSVWS to get the historical departure and arrival time?

Below is my Python code, which I have hidden my TOKEN

if LDB_TOKEN == '':
    raise Exception("Please configure your OpenLDBWS token in getDepartureBoardExample!")

history = HistoryPlugin()
client = Client(wsdl=WSDL, plugins=[history])


res = client.service.GetHistoricDepartureBoard(numRows=100, crs='EUS', historicDateTime = "2020-06-04", timeWindow = 100)                                              
                                               
print("Trains at " + res.locationName)
print("===============================================================================")
services = res.trainServices.service
i = 0
while i < len(services):
    t = services[i]
    print(t.std + " to " + t.destination.location[0].locationName + " - " + t.etd)
    i += 1


However, when I run the code, it comes an error message as below:

Fault                                     Traceback (most recent call last)
<ipython-input-318-aa756cbca099> in <module>
----> 1 res = client.service.GetHistoricDepartureBoard(numRows=100, crs='EUS', historicDateTime = "2020-06-04", timeWindow = 100)
      2 
      3 print("Trains at " + res.locationName)
      4 print("===============================================================================")
      5 services = res.trainServices.service

~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\proxy.py in __call__(self, *args, **kwargs)
     43             self._op_name,
     44             args,
---> 45             kwargs,
     46         )
     47 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py in send(self, client, options, operation, args, kwargs)
    128             return response
    129 
--> 130         return self.process_reply(client, operation_obj, response)
    131 
    132     def process_reply(self, client, operation, response):

~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py in process_reply(self, client, operation, response)
    193         fault_node = doc.find("soap-env:Body/soap-env:Fault", namespaces=self.nsmap)
    194         if response.status_code != 200 or fault_node is not None:
--> 195             return self.process_error(doc, operation)
    196 
    197         result = operation.process_reply(doc)

~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py in process_error(self, doc, operation)
    285                 code=None,
    286                 actor=None,
--> 287                 detail=etree_to_string(doc),
    288             )
    289 

Fault: Unknown fault occured


Does anyone know how to solve the error. Any suggestion would be much apprecaited.

Regards

Wei

Peter Hicks

unread,
Jun 9, 2020, 3:36:30 AM6/9/20
to A gathering place for the Open Rail Data community
Hi Wei

I believe the historical functionality is disabled in the public/lite version of the OpenLDBSVWS API - possibly because it's hard to scale.

If this is the case, I'll look to see if I can get the Python sample code updated to not generate methods for the unsupported operations.


Peter

--
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 view this discussion on the web, visit https://groups.google.com/d/msgid/openraildata-talk/4280edf7-ef00-4e27-8376-9f7b0e22c556o%40googlegroups.com.


OpenTrainTimes Ltd. registered in England and Wales, company no. 09504022.
Registered office: 13a Davenant Road, Upper Holloway, London N19 3NW

Rail Delivery Group

unread,
Jun 9, 2020, 4:03:35 AM6/9/20
to A gathering place for the Open Rail Data community
To Confirm what Peter has said, the historical functions in the LDBSV web service have been disabled for all users (including TOCs) for many years, due to limitations with the infrastructure which simply isn't suited to API access to this data. We've kept them in the API in the hope that one day the service would be able to support them and they could be enabled again - although there is little prospect of that and I might suggest they are removed at the next update to reduce confusion.

Historical information is available via HSP on opendata.nationalrail, although sadly there are issues with that service as well!

Realistically the only way to reliably do this at present is to consume push port data to build a historical record - or to see if someone who has done that already has an API that you can use.

Eventually RDG will catch up and provide a reliable, open, way of doing this but it won't unfortunately be any time soon!

RDG

Wei Wang

unread,
Jun 9, 2020, 5:57:38 AM6/9/20
to A gathering place for the Open Rail Data community
Thanks Peter and RDG for your prompt response and kind advice.

It is a pity that the historical data is no longer available from  the OpenLDBSVWS.

But the good news is that I can get the departure and arrival information from the Live Departure Boards Web Service, though I have to run the script every 2 hours to get the entire service data for the whole day.
Technically, the data, after cleaned to remove duplicated records and merged, can be saved as the historical data for future use. 
 
Regards

Wei

Ashwani Kumar

unread,
Nov 24, 2021, 8:09:09 AM11/24/21
to A gathering place for the Open Rail Data community
Hi Wei, 

Can you help me out, on how did you get the data from LDBWS. And how your script works. As I tried replacing the URL with new one, it doesn't seems to be working. 

Regards,
Ash

RailAleFan

unread,
Dec 3, 2021, 11:06:46 AM12/3/21
to A gathering place for the Open Rail Data community
Hi Ash,

Do you mind my asking what your use-case for an historic departure board is?

Idle curiosity is a perfectly good answer, but I presume there is a business case for them as the effort was put into supporting the methods in the web services.

Since publishing the archiving tool ( https://github.com/railalefan/nodeDarwinArchiver ) i've been playing around with importing the logs into something like the Darwin schema in order to recreate the historical functions of the web services but my thoughts are that interest in historic data is more summary in nature, such as the industry's own performance reporting requirements or an academic project processing the data in a very specific way in support of a research objective.

I'm just curious as to the value in knowing what the public departure board for station XYZ at YYYY-MM-DDTHH:MM:SS looked like..!

Cheers
Reply all
Reply to author
Forward
0 new messages