WS_Market
Click here for a complete list of operations.
getTransitPaths
直接轉乘不設定運具
傳入參數
| 參數名稱 | 參數型態 | 參數說明 |
| StartPoint | string | 起點經緯度 緯度X1000000,經度 X1000000,關鍵字(非必填),類型(0:道路與地址,1:POI,非必填) Ex1:"25000000,121000000" 直接用經緯度查規劃。 EX2:"25000000,121000000,中華電信" 查詢離此經緯度最近之關鍵字為中華電信之景點 |
| EndPoint | string | 終點經緯度 緯度X1000000,經度 X1000000,關鍵字(非必填),類型(0:道路與地址,1:POI,非必填) Ex1:"25000000,121000000" 直接用經緯度查規劃。 EX2:"25000000,121000000,中華電信,1" 查詢離此經緯度最近之POI關鍵字為中華電信之景點 EX3:"25000000,121000000,羅斯福路100號,0" 查詢離此經緯度最近之地址關鍵字為羅斯福路100號之地址 |
參數輸入範例
| 參數 | 值 |
| StartPoint | 25044773,121517776 |
| EndPoint | 25028835,121522003 |
回傳格式
第一部分為筆數
| 回傳值 | 說明 |
| result | 筆數 |
第二部分為多筆資料 JSONArray格式
| 回傳值 | 說明 |
| routes | 路線 (起/終點正確並查得規劃路線資料,最多三條路線) |
回傳範例
[{"result":3,"routes":[{"points":[{"id":501347,"name":"台北車站(青島)","region":3,"lat":25044773,"lon":121517776},{"id":504084,"name":"福州街口","region":3,"lat":25029249,"lon":121520545},{"id":0,"name":"終點","region":0,"lat":25028835,"lon":121522003}],"lines":[{"RouteID":275,"name":"849[烏來-台北車站]","category":1101,"period":5,"price":15,"schedule":"頭末班車:05:30-21:40 發車班距:尖峰10-15分 離峰15-20分 例假日10-20分"},{"RouteID":0,"name":"步行","category":0,"period":3,"price":0,"schedule":"170"}]},{"points":[{"id":501347,"name":"台北車站(青島)","region":3,"lat":25044773,"lon":121517776},{"id":500502,"name":"南昌公園","region":3,"lat":25027322,"lon":121520362},{"id":0,"name":"終點","region":0,"lat":25028835,"lon":121522003}],"lines":[{"RouteID":595,"name":"295[動物園-台北車站]","category":1101,"period":7,"price":15,"schedule":"捷運動物園站頭末班車:05:40-23:00 發車班距:固定班次"},{"RouteID":0,"name":"步行","category":0,"period":5,"price":0,"schedule":"286"}]},{"points":[{"id":0,"name":"起點","region":0,"lat":25044773,"lon":121517776},{"id":508367,"name":"捷運台北車站(出口8)","region":3,"lat":25046255,"lon":121517532},{"id":508379,"name":"捷運古亭站(出口7)","region":3,"lat":25026357,"lon":121522873},{"id":0,"name":"終點","region":0,"lat":25028835,"lon":121522003}],"lines":[{"RouteID":0,"name":"步行","category":0,"period":3,"price":0,"schedule":"156"},{"RouteID":50000,"name":"捷運淡水線[淡水-新店]","category":1102,"period":4,"price":20,"schedule":"頭末班車:06:00-24:00 發車班距:尖峰6-7分 離峰8-12分 例假日8-12分"},{"RouteID":0,"name":"步行","category":0,"period":5,"price":0,"schedule":"304"}]}]}]
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/getTransitPaths"
<?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>
<getTransitPaths xmlns="http://www.gotcha.com.tw/WS_Transit">
<StartPoint>string</StartPoint>
<EndPoint>string</EndPoint>
</getTransitPaths>
</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>
<getTransitPathsResponse xmlns="http://www.gotcha.com.tw/WS_Transit">
<getTransitPathsResult>string</getTransitPathsResult>
</getTransitPathsResponse>
</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>
<getTransitPaths xmlns="http://www.gotcha.com.tw/WS_Transit">
<StartPoint>string</StartPoint>
<EndPoint>string</EndPoint>
</getTransitPaths>
</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>
<getTransitPathsResponse xmlns="http://www.gotcha.com.tw/WS_Transit">
<getTransitPathsResult>string</getTransitPathsResult>
</getTransitPathsResponse>
</soap12:Body>
</soap12:Envelope>