Not Recognising SOAP Action

184 views
Skip to first unread message

Alexander MacLeod

unread,
Aug 12, 2017, 7:59:38 PM8/12/17
to A gathering place for the Open Rail Data community
Dear all,

I am attempting to query GetDepartureBoard using the latest version of the WSDL for OpenLDBWS. I had used ldb9.asmx with the following code with no problems but having updated to ldb10.asmx, I am receiving the error: "Server did not recognize the value of HTTP Header SOAPAction: GetDepartureBoard"

let url = "https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb10.asmx"

let encoding = "<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:typ="http://thalesgroup.com/RTTI/2017-02-02/Token/types" xmlns:ldb="http://thalesgroup.com/RTTI/2017-02-02/ldb/">

 <soap:Header>

    <typ:AccessToken>

       <typ:TokenValue>XXXX-XXXXXX-XXXXX-XXXXXX</typ:TokenValue>

    </typ:AccessToken>

 </soap:Header>

 <soap:Body>

    <ldb:GetDepartureBoardRequest>

       <ldb:numRows>2</ldb:numRows>

       <ldb:crs>LEU</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>"


Alamofire.request(url, method: .post, parameters: ["content-type":"text/xml"], encoding: encoding, headers: ["SOAPAction":"GetDepartureBoard"]).response


I am a bit confused why suddenly my configuration fails to work but I would appreciate any feedback. Thanks!

NRE Online Services

unread,
Aug 13, 2017, 4:25:56 AM8/13/17
to A gathering place for the Open Rail Data community
I believe the typ namespace is wrong. try xmlns:typ="http://thalesgroup.com/RTTI/2013-11-28/Token/types"

note that the ldb namespace was updated between v9 and v10 but the typ (which relates to the token) was not.

Alexander MacLeod

unread,
Aug 13, 2017, 5:02:21 AM8/13/17
to A gathering place for the Open Rail Data community
Unfortunately, having updated my code, this makes no difference and the error message remains the same.

NRE Online Services

unread,
Aug 14, 2017, 5:05:43 AM8/14/17
to A gathering place for the Open Rail Data community
Unfortunately I can't add anything further as copying your example above into SoapUI I get an error when the namespaces are specified as:
but replacing this line with the below works fine using Soap1.2:


and I can't see any other differences. The only thing I can suggest is that the service supports both Soap 1.1 and Soap 1.2 and there are subtle differences in the raw traces within SoapUI so it might have something to do with your bindings

Soap 1.1:

POST http://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb10.asmx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://thalesgroup.com/RTTI/2012-01-13/ldb/GetDepartureBoard"
Content-Length: 726
Host: lite.realtime.nationalrail.co.uk
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


Soap1.2:

POST http://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb10.asmx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/soap+xml;charset=UTF-8;action="http://thalesgroup.com/RTTI/2012-01-13/ldb/GetDepartureBoard"
Content-Length: 689
Host: lite.realtime.nationalrail.co.uk
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Alexander MacLeod

unread,
Aug 14, 2017, 6:22:27 AM8/14/17
to A gathering place for the Open Rail Data community
After confirming that I was using a valid typ namespace and I had a deeper look into my bindings. There was indeed a mistake and the issue is now resolved. Thank you very much for your help!
Reply all
Reply to author
Forward
0 new messages