OpendataCH / Transport

Swiss public transport API
http://transport.opendata.ch/
MIT License
241 stars 50 forks source link

Access data from ZVV using their HAFAS endpoint #105

Open Feuermurmel opened 9 years ago

Feuermurmel commented 9 years ago

It seems that the data returned for the ZVV services does not contain any prognoses when the pre-configured endpoint from the SBB is used. Has anyone already tried to access the HAFAS endpoint from the ZVV?

I looked at the data transferred when making requests from the ZVV app for iPhone but they don't look like anything I recognize. The HTTP requests say that they're using a content type application/x-www-form-urlencoded, but the body contains binary data. The responses use a content type of application/x-bxml.

Searching for that string lead me to the specification for Binary XML, but it doesn't look like the data is in that format, or was encoded further because the header does not match the description in the specification for that format.

dragoon commented 9 years ago

Hello,

I think ZVV endpoint does not support "extxml.exe" interface as SBB. What I ended up is implementing a connector to "stboard.exe" and "query.exe" endpoint. You can see how it works in my fork of the repo (https://github.com/dragoon/Transport/blob/master/lib/Transport/Providers/ZVV.php).

derhuerst commented 7 years ago

I looked at the data transferred when making requests from the ZVV app for iPhone but they don't look like anything I recognize.

That sounds like it's gzipped. Tools like mitmproxy (or Wireshark) will automatically display plain text if it is gzipped. Maybe it is also Binary XML, gzipped.

Look for the Content-Encoding HTTP header.

derhuerst commented 7 years ago

I think ZVV endpoint does not support "extxml.exe" interface as SBB.

Is there a /bin/mgate.exe route available for ZVV? This is what the apps for Berlin (VBB, BVG) and Deutsche Bahn talk to. See vbb-hafas for an almost feature-complete client.

derhuerst commented 6 years ago

FYI there is Java code querying query.exe from ZVV.