OpenLDBWS Troubleshooting

From Open Rail Data Wiki
Revision as of 20:55, 11 July 2015 by Q (talk | contribs) (Added category)
Jump to navigation Jump to search

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:

<ns2:AccessToken>
 <ns2:TokenValue>*** TOKEN GOES HERE ***</ns2:TokenValue>
</ns2:AccessToken>

The 'ns2' namespace must be the 'commontypes' 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,

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 commontypes namespace (http://thalesgroup.com/RTTI/YYYY-MM-DD/ldb/commontypes, e.g. http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes)
  • 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/)