Help with POSTing a request

196 views
Skip to first unread message

Darryl Strong

unread,
Oct 1, 2021, 7:16:21 AM10/1/21
to A gathering place for the Open Rail Data community
Hi All,

I am new to this so I apologise in advance if this has been covered before but I cannot find any examples.

Trying to do a POST request in Postman using this URL:
and this raw body data:
   <soap:Header>
   <ns0:AccessToken xmlns:ns0="http://thalesgroup.com/RTTI/2013-11-28/Token/types"><ns0:TokenValue>MYTOKEN</ns0:TokenValue></ns0:AccessToken>
        </soap:Header>
   <soap:Body>
      <ldb:GetDepartureBoardRequest>
         <ldb:numRows>2</ldb:numRows>
         <ldb:crs>SOU</ldb:crs>
         <ldb:filterCrs></ldb:filterCrs>
         <ldb:filterType>to</ldb:filterType>
         <ldb:timeOffset>0</ldb:timeOffset>
         <ldb:timeWindow>120</ldb:timeWindow>
      </ldb:GetDepartureBoardRequest>
   </soap:Body>
</soap:Envelope>

The data I receive is this:

<?xml version="1.0" encoding="utf-8"?>
    <wsdl:import namespace="http://thalesgroup.com/RTTI/2017-10-01/ldb/" location="rtti_2017-10-01_ldb.wsdl" />
    <wsdl:service name="ldb">
        <wsdl:port name="LDBServiceSoap" binding="tns:LDBServiceSoap">
            <soap:address location="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb11.asmx" />
        </wsdl:port>
        <wsdl:port name="LDBServiceSoap12" binding="tns:LDBServiceSoap12">
            <soap12:address location="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb11.asmx" />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

I cannot see where I am going wrong.  Can anyone shed some light please?

Cheers

Darryl

Peter Hicks

unread,
Oct 1, 2021, 7:18:28 AM10/1/21
to A gathering place for the Open Rail Data community
Hi Darryl


On 1 Oct 2021, at 11:48, 'Darryl Strong' via A gathering place for the Open Rail Data community <openrail...@googlegroups.com> wrote:

Trying to do a POST request in Postman using this URL:

I think that’s the issue - you’re POST-ing the request to the WSDL - the actual API definition URL, not the SOAP endpoint at https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb11.asmx, which is referenced in the WSDL!


Peter




OpenTrainTimes Ltd. registered in England and Wales, company no. 09504022.
Registered office: Suite 1-3, Hop Exchange, 24 Southwark Street, London SE1 1TY

Darryl Strong

unread,
Oct 1, 2021, 7:25:42 AM10/1/21
to A gathering place for the Open Rail Data community
Hi Peter,

Thank you for the fast response. Testing using the SOAP endpoint and I get this...

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>
<style type="text/css">

Do I need a username/password?

Darryl


RailAleFan

unread,
Oct 1, 2021, 8:22:22 AM10/1/21
to A gathering place for the Open Rail Data community
Hi Darryl,

You don't need any other credentials than your access token but I'm not sure the soap header is correct having re-declared the typ namespace as ns0 within the element itself, have a go with:

     <typ:AccessToken><typ:TokenValue>MYTOKEN</typ:TokenValue></typ:AccessToken>

   </soap:Header>
   <soap:Body>
      <ldb:GetDepartureBoardRequest>
         <ldb:numRows>2</ldb:numRows>
         <ldb:crs>SOU</ldb:crs>
         <ldb:filterCrs></ldb:filterCrs>
         <ldb:filterType>to</ldb:filterType>
         <ldb:timeOffset>0</ldb:timeOffset>
         <ldb:timeWindow>120</ldb:timeWindow>
      </ldb:GetDepartureBoardRequest>
   </soap:Body>
</soap:Envelope>


Hope this helps!
Cheers

Darryl Strong

unread,
Oct 2, 2021, 9:20:04 AM10/2/21
to A gathering place for the Open Rail Data community
I shall give that a go Monday when back in the office, thank you :)

Darryl Strong

unread,
Oct 4, 2021, 3:35:16 AM10/4/21
to A gathering place for the Open Rail Data community
Sorted! Thanks Chaps.
Reply all
Reply to author
Forward
0 new messages