WAP/WML interfaces

part of the ArsDigita Community System by Andrew Grumet

The Big Picture

We want to make site content available to wireless devices like cell phones. The prototypical application is a WAP-accessible phone directory which lets you look up a phone number by keying in the first few letters of the person's name or email address, and then serves up the number providing a link to call that number.

The Medium-Sized Picture

A WAP device connects to a gateway which issues HTTP requests on behalf of the device. No modifications of the web server itself are needed---content is served over HTTP---but new headers and markup are needed. Pages are built according to the Wireless Markup Language DTD, proposed and maintained by the WAP Forum.

Besides learning new syntax, the major considerations when building WAP pages are:

The Gory Details

The Steps

To add wap services to your module:
  1. Add a link to your service in the top level page at /wap/i.wap (this needs to be integrated with the module registry).
  2. Learn to code WML. You might want to read the WML specification.
  3. For logic, make use of the API functions in wap-defs. Useful procs: util_guess_doctype, wap_maybe_redirect_for_registration, wap_returnredirect, wml_return
  4. For debugging, you may want to run a WAP-enabled browser on your PC. These can be downloaded from Alternatively, the telnet method works quite well too.


; do we serve the generated /wap/index page or something 
; else from the file system?  This should be the FULL PATH relative
; to page root.
; how long between lookups of the known user agent list?
; where to import user-agents strings from
; what tcl procedure to use to parse the data returned
; from the page listed above
; how long between http GET's?
; how many characters in the User-Agent string
; should we compare against?
; are we doing HTML browser-based debugging?
; to save typing when logging in