2017-08-03 65 views
0

嘗試使用SOAP XML與Postman進行National Rail API調用,但獲取「401 - 未經授權:訪問由於無效憑證而被拒絕」響應。以下是我有:通過Postman進行National Rail SOAP XML API調用

地址欄

POST https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb10.asmx 

頁眉:

Content-Type: text/xml;charset=UTF-8 
SOAPAction: http://thalesgroup.com/RTTI/2017-02-02/ldb/GetDepartureBoard 
Accept-encoding: gzip, x-gzip, deflate, x-bzip2 

身體:

<soap:Envelope 
    xmlns:ldb="http://thalesgroup.com/RTTI/2017-02-02/ldb/" 
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
    xmlns:typ="http://thalesgroup.com/RTTI/2017-02-02/Token/types"> 
    <soap:Header> 
    <typ:AccessToken> 
     <typ:TokenValue>**** token removed ****</typ:TokenValue> 
    </typ:AccessToken> 
    </soap:Header> 
    <soap:Body> 
    <ldb:GetDepartureBoardRequest> 
     <ldb:crs>LST</ldb:crs> 
     <ldb:numRows>10</ldb:numRows> 
     <ldb:timeOffset>0</ldb:timeOffset> 
     <ldb:timeWindow>120</ldb:timeWindow> 
    </ldb:GetDepartureBoardRequest> 
    </soap:Body> 
</soap:Envelope> 

有些文檔是在這裏:https://lite.realtime.nationalrail.co.uk/openldbws/

例C -111這裏:http://nrodwiki.rockshore.net/index.php/GetDepBoardWithDetails

任何援助,將不勝感激 - 我想知道如何正確地進行API調用,所以我可以用我的業餘愛好項目的應用進展。

回答

0

更改地址:

https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb9.asmx 

更改肥皂:信封

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
xmlns:typ="http://thalesgroup.com/RTTI/2013-11-28/Token/types" 
xmlns:ldb="http://thalesgroup.com/RTTI/2016-02-16/ldb/"> 

如果使用有效的標記,這將工作(我在郵差測試)。

希望有所幫助。