WS_Market
Click here for a complete list of operations.
getTrainLinesByDateRange
以起站/終站POIID、日期、(或火車種類)來查詢班次(適用於火車、高鐵)
傳入參數參數名稱 參數型態 參數說明 nCategoryID int 交通工具類別 nDepartPOIID int 起站之POIID nArrivalPOIID int 到站之POIID
nTrainType int 火車種類(高鐵填0)
火車車種為bitmask的值,車種mask值參照
API getTaiTrainCarClassstr_Start_Date string yyyy-MM-dd
年-月-日
str_End_Date
string
yyyy-MM-dd
年-月-日
參數輸入範例參數 值 nCategoryID 1104 nDepartPOIID 552459 nArrivalPOIID 553815 nTrainType 65535
str_Start_Date 2014-09-30
str_End_Date
2014-09-30
回傳格式回傳值 說明 RouteID 班次routeID name 班次名稱 type 火車種類 stime 起站時間 etime 終站時間 DateTypeID 日期型態代碼 price 價格
Date 行駛日期 TypeName
火車種類名稱
回傳範例
[ { "View_Lines":[ { "RouteID":64218, "name":"1802-新竹-內灣", "type":128, "stime":327, "etime":331, "DateTypeID":127, "price":15, "Date":"2014-09-30 05:27:00", "TypeName":"區間車" }, { "RouteID":64143, "name":"1702-新竹-六家", "type":128, "stime":376, "etime":379, "DateTypeID":127, "price":15, "Date":"2014-09-30 06:16:00", "TypeName":"區間車" } ] } ]
Test
The test form is only available for requests from the local machine.SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /WS_Market.asmx HTTP/1.1 Host: transittw.localking.com.tw Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://www.gotcha.com.tw/WS_Transit/getTrainLinesByDateRange" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <AuthHeaderMarket xmlns="http://www.gotcha.com.tw/WS_Transit"> <Username>string</Username> <HashKey>string</HashKey> <Password>string</Password> </AuthHeaderMarket> </soap:Header> <soap:Body> <getTrainLinesByDateRange xmlns="http://www.gotcha.com.tw/WS_Transit"> <nCategoryID>int</nCategoryID> <nDepartPOIID>int</nDepartPOIID> <nArrivalPOIID>int</nArrivalPOIID> <nTrainType>int</nTrainType> <str_Start_Date>string</str_Start_Date> <str_End_Date>string</str_End_Date> </getTrainLinesByDateRange> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getTrainLinesByDateRangeResponse xmlns="http://www.gotcha.com.tw/WS_Transit"> <getTrainLinesByDateRangeResult>string</getTrainLinesByDateRangeResult> </getTrainLinesByDateRangeResponse> </soap:Body> </soap:Envelope>
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /WS_Market.asmx HTTP/1.1 Host: transittw.localking.com.tw Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Header> <AuthHeaderMarket xmlns="http://www.gotcha.com.tw/WS_Transit"> <Username>string</Username> <HashKey>string</HashKey> <Password>string</Password> </AuthHeaderMarket> </soap12:Header> <soap12:Body> <getTrainLinesByDateRange xmlns="http://www.gotcha.com.tw/WS_Transit"> <nCategoryID>int</nCategoryID> <nDepartPOIID>int</nDepartPOIID> <nArrivalPOIID>int</nArrivalPOIID> <nTrainType>int</nTrainType> <str_Start_Date>string</str_Start_Date> <str_End_Date>string</str_End_Date> </getTrainLinesByDateRange> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <getTrainLinesByDateRangeResponse xmlns="http://www.gotcha.com.tw/WS_Transit"> <getTrainLinesByDateRangeResult>string</getTrainLinesByDateRangeResult> </getTrainLinesByDateRangeResponse> </soap12:Body> </soap12:Envelope>