The CTA Bus-Tracker Services

The Amazon websites for shopping, storage, and cloud computing are rich in content and functionality—and the corresponding web services inherit these very attributes. Amazon, moreover, is a pioneer and a major player in web services, SOAP-based and REST-style. Social networking sites such as Facebook, Twitter, and Tumblr support RESTful services against their sites. Indeed, the trend among serious websites, large or small, is to provide RESTful access and an API in support of such access. For contrast, this section considers a relatively recent and, in comparison with Amazon, small-scale effort at RESTful web services: bus tracking at the CTA (Chicago Transit Authority).

The Amazon E-Commerce service has a standard design in that a single service encapsulates many operations, for instance, operations to search, look up, order, clear a shopping cart, and so on. The CTA takes a different approach in that each service consists of a single operation; there is a separate XML Schema per service. The services are thus quite simple, and the schemas range in size from about 12 to 36 lines. The simplest service returns the current local time; more complicated services report on buses en route and on their routes, expected bus arrival times at particular locations, vehicles in operation, and the like.

Use of the bus-tracking service, through the website or a web service, requires a key (see Registering with the CTA) from the CTA. The key occurs as a query string ...

Get Java Web Services: Up and Running, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.