LDBWS Next Fastest - Not working?

171 views
Skip to first unread message

Mark Jenkins

unread,
Aug 25, 2021, 10:49:50 AM8/25/21
to A gathering place for the Open Rail Data community
Hi All,

Wonder if you can tell me what I'm doing wrong here please?  My code is successfully pulling GetDepBoardWithDetails and GetArrBoardWithDetails (slightly different soap body to below as the parameters differ) but when I try GetFastestDeparturesWithDetails I get server response 500.

Here's the SOAP request body, I've checked the parameters against the Wiki and tried it with timeOffset, timeWindow and filterList tags and without - no luck.  I also used the schema references from the Wiki (however the ones below work for me with Dep/Arr boards).

     <?xml version="1.0" encoding="utf-8"?> 
     <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
     xmlns:ldb="http://thalesgroup.com/RTTI/2017-10-01/ldb/"      
      <soap:Header>
         <typ:AccessToken> 
               <typ:TokenValue>TOKEN</typ:TokenValue> 
          </typ:AccessToken> 
      </soap:Header>
      <soap:Body>
          <ldb:GetFastestDeparturesWithDetailsRequest> 
              <ldb:crs>EDB</ldb:crs>  
          </ldb:GetFastestDeparturesWithDetailsRequest>
       </soap:Body> 
     </soap:Envelope>

Here is how the request is made in Flutter/Dart.  I know this works for the other request types.  RequestType is "GetFastestDeparturesWithDetails".

     response = await http.post(
             Uri.https("lite.realtime.nationalrail.co.uk","/OpenLDBWS/ldb11.asmx"),
     headers: {
               "content-Type": "text/xml; charset=utf-8",
               "SOAPAction":
     },
     body: requestBody).timeout(const Duration(seconds: 30));

Help appreciated.

Many Thanks
Mark

RailAleFan

unread,
Aug 25, 2021, 11:23:45 AM8/25/21
to A gathering place for the Open Rail Data community
Hi Mark,

GetFastestDeparturesWithDetails requires the filterList parameter of between 1 and 10 locations to return the next fastest train to; example request body for Reading to London Paddington / Bristol TM...

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:ns1="http://thalesgroup.com/RTTI/2017-10-01/ldb/"
  xmlns:ns2="http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes">
  <SOAP-ENV:Header>
    <ns2:AccessToken>
      <ns2:TokenValue>TOKEN</ns2:TokenValue>
    </ns2:AccessToken>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:GetFastestDeparturesWithDetailsRequest>
      <ns1:crs>RDG</ns1:crs>
      <ns1:filterList>
        <ns1:crs>PAD</ns1:crs>
        <ns1:crs>BRI</ns1:crs>
      </ns1:filterList>
    </ns1:GetFastestDeparturesWithDetailsRequest>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Cheers

Mark Jenkins

unread,
Aug 25, 2021, 11:35:52 AM8/25/21
to A gathering place for the Open Rail Data community
Thanks for the quick reply - understood, that's clear

The API is really unhelpful though, it means you have to know possible destinations in advance for every station, or pull a current timetable (multiple times since LDBWS only allows 10 rows per call) to research destinations for a station.  That would significantly ramp up the number of data calls which is somewhere I don't want to go.

Do you know if there is there a resource that gives possible destinations for all stations please?  

If not, I'm working on a server back end and have access to PushPort so thinking I could parse this from eg: Snapshot data and store a static matrix as a best approximation, would only have to store the from/to CRS so needn't bee too bulky.  Does that sound a sensible compromise?

Many thanks
Mark

RailAleFan

unread,
Aug 25, 2021, 12:26:49 PM8/25/21
to A gathering place for the Open Rail Data community
Hi Mark,

Yes, except for the quietest of locations I don't think there's viable solution for an A-Z of "Next Fastest Train To" via the web services.

The best you could do I think would be GetDepBoardWithDetails and then loop over the results to get the next fastest to each distinct location but with the 10 service response limit of the *WithDetails methods and stations like Clapham Junction having 10 departures in the space of 3 minutes that's not really a general purpose option.

Push Port is the way to go for this - a consumer process dedicated to populating a database of Fastest A-Z rather than a complete replication of the Darwin database is almost certainly an option...

Cheers

Mark Jenkins

unread,
Aug 25, 2021, 12:55:33 PM8/25/21
to A gathering place for the Open Rail Data community
Cheers, I'll take a look at my pushport data and see what I find.

Thanks again!

Reply all
Reply to author
Forward
0 new messages