Advice for a NOOB please on how to ping the NRE API (LDBWS) from a Raspberry Pi using python

413 views
Skip to first unread message

chil...@gmail.com

unread,
Oct 6, 2015, 9:03:57 AM10/6/15
to A gathering place for the Open Rail Data community
Hi there,

As a NOOB is anyone able to give me any advice on the syntax I need to follow, using the GetDepartureBoard response (found here https://lite.realtime.nationalrail.co.uk/OpenLDBWS/) so I could just print the response locally to start with, given the following:

1. I'm running this from a raspberry pi using python.
2. I've received from token from national rail
3. I've executed the line of python code below and received a <Response [200]> back, which from the HTTP status code definitions gives me small hope!

token = "MyPrivateTokenWouldGoHere"
url = "https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2015-05-14"


import requests

r = requests.get(url,auth=(token,''))
print r

I have tried a variety of different ways to include the GetDepartureBoard response, either as a separate call that follows on immediately after r = r.requests.get(url,auth=(token1,'')) or within the parenthesis of the command.

Thanks
Chris

Peter Hicks

unread,
Oct 6, 2015, 9:06:44 AM10/6/15
to chil...@gmail.com, A gathering place for the Open Rail Data community
Hi Chris


You need to use a SOAP library to send and receive responses, or https://huxley.unop.uk/ which is a front-end proxy that you can run yourself.


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 post to this group, send an email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Goldberg

unread,
Oct 6, 2015, 9:06:49 AM10/6/15
to chil...@gmail.com, A gathering place for the Open Rail Data community
It hides all the SOAP stuff you would need to do if you try and access the raw API using requests.

--
George

chil...@gmail.com

unread,
Oct 6, 2015, 1:26:19 PM10/6/15
to A gathering place for the Open Rail Data community, chil...@gmail.com
Thanks gents, quite chuffed with myself as now able to a request for my local station's departure board, small steps and all that ;-)
Reply all
Reply to author
Forward
0 new messages