WS_Market
Click here for a complete list of operations.
getRouteInfo_TimeTable
公車、捷運、長途客運或船舶營運班次的時刻表(若為文字敘述而非固定班表,則回傳字串即可,如: "timetable":"頭末班車0600-2400..."
傳入參數
| 參數名稱 | 參數型態 | 參數說明 |
| nRouteID | int | 路線ID |
參數輸入範例
| 參數 | 值 |
| nRouteID | 119 |
回傳格式
第一部分為文字訊息
| 回傳型態 | 說明 |
| string | 文字訊息 |
第二部分為多筆資料JSON
| 回傳值 | 說明 |
| DateTypeID | 日期型態代碼 |
| Schedule | 發車時間,以分為單位(ex:340代表 05:40) |
| StationName | 發車站名稱 |
| Note | 註記 |
回傳範例
["頭末班車:05:30-22:00 發車班距:尖峰7-10分 離峰12-15分 例假日15-20分",{"timetable":[{"DateTypeID":3,"Schedule":330,"StationName":"台北客運四海站","Note":""},{"DateTypeID":3,"Schedule":345,"StationName":"台北客運四海站","Note":""},{"DateTypeID":3,"Schedule":360,"StationName":"台北客運四海站","Note":""},{"DateTypeID":3,"Schedule":375,"StationName":"台北客運四海站","Note":""}]}]
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/getRouteInfo_TimeTable"
<?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>
<getRouteInfo_TimeTable xmlns="http://www.gotcha.com.tw/WS_Transit">
<nRouteID>int</nRouteID>
</getRouteInfo_TimeTable>
</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>
<getRouteInfo_TimeTableResponse xmlns="http://www.gotcha.com.tw/WS_Transit">
<getRouteInfo_TimeTableResult>string</getRouteInfo_TimeTableResult>
</getRouteInfo_TimeTableResponse>
</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>
<getRouteInfo_TimeTable xmlns="http://www.gotcha.com.tw/WS_Transit">
<nRouteID>int</nRouteID>
</getRouteInfo_TimeTable>
</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>
<getRouteInfo_TimeTableResponse xmlns="http://www.gotcha.com.tw/WS_Transit">
<getRouteInfo_TimeTableResult>string</getRouteInfo_TimeTableResult>
</getRouteInfo_TimeTableResponse>
</soap12:Body>
</soap12:Envelope>