OpenLDBWS Troubleshooting: Difference between revisions

From Open Rail Data Wiki
Q (talk | contribs)
m Added category
m →‎Token must be supplied in the SOAP header: Remove unnecessary space after the code example
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
== Testing ==
In order to test the service, understand how to craft requests and test responses you should download [https://www.soapui.org/ SoapUI]. Check/Change the 'Preferences' 'HTTP Settings' so that 'Request Compression' is set to 'None' (Else the server will return a 401 Access denied message), and under 'WSDL Settings' enable 'Sample Values' and 'Include Optional'. Create a new SOAP project and add the WSDL URL (https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx - for the public version, or https://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/wsdl.aspx - for the staff version) and it will discover all of the exposed services, build your queries, and enter sample data so you gain an understanding of what you need to provide without having to trawl through the schema manually. So far this is the only tool I've found which works across all platforms (Windows, Mac, Linux) which gives consistent results.
== 401 Unauthorized - Access is denied due to invalid credentials ==
== 401 Unauthorized - Access is denied due to invalid credentials ==


Line 14: Line 18:


<pre>
<pre>
<ns2:AccessToken>
<typ:AccessToken>
<ns2:TokenValue>*** TOKEN GOES HERE ***</ns2:TokenValue>
  <typ:TokenValue>nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn</typ:TokenValue>
</ns2:AccessToken>
</typ:AccessToken>
</pre>
</pre>


The 'ns2' namespace must be the 'commontypes' namespace.
The 'typ' namespace must be the 'tokentypes' namespace.


=== Use a POST request ===
=== Use a POST request ===


SOAP requests must be sent using HTTP POST.  If you're using an HTTP GET, there will be no token and you will receive a 401 Unauthorized error,
SOAP requests must be sent using HTTP POST.  If you're using an HTTP GET, there will be no token and you will receive a 401 Unauthorized error.
 
=== Check Compression Settings ===
Check you are not sending your requests compresses. In testing with SoapUI the server appears to reject *any* compressed request.


== SOAP Fault - Server was unable to process request ==
== SOAP Fault - Server was unable to process request ==
Line 32: Line 39:


* The SOAP Envelope, Header and Body tags must be part of the SOAP namespace (<nowiki>http://schemas.xmlsoap.org/soap/envelope/</nowiki>)
* The SOAP Envelope, Header and Body tags must be part of the SOAP namespace (<nowiki>http://schemas.xmlsoap.org/soap/envelope/</nowiki>)
* The AccessToken and TokenValue tags in the SOAP Header tag must be from the commontypes namespace (<nowiki>http://thalesgroup.com/RTTI/YYYY-MM-DD/ldb/commontypes</nowiki>, e.g. <nowiki>http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes</nowiki>)
* The AccessToken and TokenValue tags in the SOAP Header tag must be from the Token namespace (<nowiki>http://thalesgroup.com/RTTI/2013-11-28/Token/types</nowiki>, e.g. <nowiki>https://lite.realtime.nationalrail.co.uk/OpenLDBWS/darwin_token_types_2013-11-28.xsd</nowiki> [public] or <nowiki>https://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/darwin_token_types_2013-11-28.wsdl</nowiki> [staff])
 
* The request in the SOAP Body must be part of the LDB namespace (<nowiki>http://thalesgroup.com/RTTI/YYYY-MM-DD/ldb/</nowiki>, e.g. <nowiki>http://thalesgroup.com/RTTI/2014-02-20/ldb/</nowiki>)
* The request in the SOAP Body must be part of the LDB namespace (<nowiki>http://thalesgroup.com/RTTI/YYYY-MM-DD/ldb/</nowiki>, e.g. <nowiki>http://thalesgroup.com/RTTI/2014-02-20/ldb/</nowiki>)


{{Navtable-NreDataFeeds}}
[[Category:National Rail Enquiries Data Feeds]]
[[Category:National Rail Enquiries Data Feeds]]

Latest revision as of 13:04, 30 December 2018

Testing

In order to test the service, understand how to craft requests and test responses you should download SoapUI. Check/Change the 'Preferences' 'HTTP Settings' so that 'Request Compression' is set to 'None' (Else the server will return a 401 Access denied message), and under 'WSDL Settings' enable 'Sample Values' and 'Include Optional'. Create a new SOAP project and add the WSDL URL (https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx - for the public version, or https://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/wsdl.aspx - for the staff version) and it will discover all of the exposed services, build your queries, and enter sample data so you gain an understanding of what you need to provide without having to trawl through the schema manually. So far this is the only tool I've found which works across all platforms (Windows, Mac, Linux) which gives consistent results.

401 Unauthorized - Access is denied due to invalid credentials

This error is common, and can be caused for a variety of reasons:

Token must be correctly formatted

Tokens are in the format nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn, where each 'n' represents a hexadecimal character (0-9 or a-f).

The letters 'A' to 'F' must be lower-case, otherwise the token will not be valid.

Token must be supplied in the SOAP header

The only place the token needs to be specified is within the SOAP envelope in the Header. It must be enclosed in a tag called 'TokenValue', wrapped within the 'AccessToken' tag, like this:

<typ:AccessToken>
  <typ:TokenValue>nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn</typ:TokenValue>
</typ:AccessToken>

The 'typ' namespace must be the 'tokentypes' namespace.

Use a POST request

SOAP requests must be sent using HTTP POST. If you're using an HTTP GET, there will be no token and you will receive a 401 Unauthorized error.

Check Compression Settings

Check you are not sending your requests compresses. In testing with SoapUI the server appears to reject *any* compressed request.

SOAP Fault - Server was unable to process request

If your SOAP request is malformed, you will receive this SOAP fault.

Check that you are using the correct namespace:

  • The SOAP Envelope, Header and Body tags must be part of the SOAP namespace (http://schemas.xmlsoap.org/soap/envelope/)
  • The AccessToken and TokenValue tags in the SOAP Header tag must be from the Token namespace (http://thalesgroup.com/RTTI/2013-11-28/Token/types, e.g. https://lite.realtime.nationalrail.co.uk/OpenLDBWS/darwin_token_types_2013-11-28.xsd [public] or https://lite.realtime.nationalrail.co.uk/OpenLDBSVWS/darwin_token_types_2013-11-28.wsdl [staff])
  • The request in the SOAP Body must be part of the LDB namespace (http://thalesgroup.com/RTTI/YYYY-MM-DD/ldb/, e.g. http://thalesgroup.com/RTTI/2014-02-20/ldb/)


National Rail Enquiries Data Feeds
Data Feeds About the Feeds Darwin Webservice (Public) Darwin Webservice (Staff) Historical Service Performance Push Port KnowledgeBaseDTDLocations (PoC)Real Time Journey Planner
LDB API About
LDB-SV API About
HSP About
DTD About Fares Timetable
Push Port About XML Schemas Schedules Associations Train Status Station Messages Alarms Train Order Train Alerts Formations Formation loading