WS_Market


Click here for a complete list of operations.

getTrainLinesByDateRange


以起站/終站POIID、日期、(或火車種類)來查詢班次(適用於火車、高鐵)
傳入參數
參數名稱參數型態參數說明
nCategoryIDint交通工具類別
nDepartPOIIDint起站之POIID
nArrivalPOIIDint到站之POIID
nTrainTypeint火車種類(高鐵填0)
火車車種為bitmask的值,車種mask值參照
API getTaiTrainCarClass
str_Start_Datestringyyyy-MM-dd
年-月-日
str_End_Date string yyyy-MM-dd
年-月-日

參數輸入範例
參數
nCategoryID1104
nDepartPOIID552459
nArrivalPOIID553815
nTrainType65535
str_Start_Date2014-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>