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.

Parameters

[ns/server/yourservername/acs/wap]
; 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.
SpecialIndexPage=/wap/i.wap
; how long between lookups of the known user agent list?
WapUserAgentDbRefresh=300
; where to import user-agents strings from
WapImportSiteURL=http://wap.colorline.no/wap-faq/useragents.php3
; what tcl procedure to use to parse the data returned
; from the page listed above
WapImportParseProc=wap_import_parse
; how long between http GET's?
WapImportRefreshTimeout=120
; how many characters in the User-Agent string
; should we compare against?
WapUAStringCompareLength=4
; are we doing HTML browser-based debugging?
WapHTMLDebugMode=0
; to save typing when logging in
WapDefaultEmailDomain=arsdigita.com

More


aegrumet@arsdigita.com