[Zope] WAP/WML for Cell Phone Wireless Web?
Duncan Booth
duncan@rcp.co.uk
Mon, 1 Nov 1999 11:43:17 +0000
> Has anyone looked at using Zope to serve WML (wireless markup
> language) pages that can be read by cell-phones. I'm here in
> Washington DC, and it seems as if Sprint PCS will have this
> service soon. It sounds pretty good.
See http://www.rcp.co.uk/distributed/wapdemo for a demonstration
WAP application written using Zope (HTML pages with screenshots,
and also a link to the actual demo for those with WAP browsers).
You need a Nokia toolkit to run the demo, there are issues using a
real 7110, or a non-Nokia browser.
> So all a zope site would have to do is add a new mime type
> (not sure what it is), and serve up the wml rather than html.
Setting the mime type is the easy bit. Actually my
standard_wap_header checks the browser and sets the mime type
to text/plain if it is begins with Mozilla, and WAP otherwise. This is
useful for debugging.
standard_wap_header:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<!-- content-type set in footer -->
<wml>
standard_wap_footer:
</wml>
<dtml-if "HTTP_USER_AGENT[:7]!='Mozilla'">
<dtml-call "RESPONSE.setHeader('Content-Type',
'text/vnd.wap.wml')">
<dtml-else>
<dtml-call "RESPONSE.setHeader('Content-Type', 'text/plain')">
</dtml-if>
Harder bits include:
POST doesn't work with some browsers (I am told the authors on at
least one browser claim that the standard makes it perfectly legal to
use a page from cache instead of rerequesting a page even if it was
originally returned as a result of a POST with different field values.)
I also hear that the 7110 limits URLs to 127 characters, so that kind
of messes up storing session information in the request string,
although that is what my demo currently does).
The phone variables may be cleared on a least recently used basis
at any time, so you cannot reliably store session information there
either. Cookies are not supported by any of the existing gateways,
(apparently this is because privacy issues preclude the identity of
the phone being made available to the gateway).
Decks are limited to 1400 bytes after compilation. Compilation
normally makes pages smaller, but can make them larger. (A python
WML compiler would be really useful here.) A lot of my zope code
was to do with splitting long lists up into smaller lists spread over
multiple decks.
Strange inconsistencies between browser make it almost impossible
to write one WAP application that runs on more than one browser.
for example, the top page of my demo includes two links on the
options menu which on the Nokia emulator are listed with
appropriate captions. On the Nokia 7110 phone these links both
display with the caption 'Unknown'.
--
Duncan Booth duncan@dales.rmplc.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
http://dales.rmplc.co.uk/Duncan