Download Wireless Application Protocol - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!
WAP and WML The Wireless Application Protocol
WAP architecture WML document structure WML syntax
•Basic document syntax•Layout•Text formatting•Images•Navigation•Events•Variables
WAP and WML
WAP Architecture ^
Do you still need a web server?^
Early WAP server designs included an HTML-to-WMLconverter. The theory was that you could serve your originalcontent, just reformulate the tags into WML in an automatedmanner. Your web server became a back end behind yourWAP server; the WAP server would translate requests fromthe Gateway, through to the web server, and back. ^
This failed painfully.
It’s clear now that your content needs to
either be in WML, or you need to design for a one-inch-squarescreen in your HTML.
So, if not a web server, then--?^
Your WAP server
is
the web server.
^
You can serve both types of content from one system.
WAP Architecture ^
Follow the request:^
Client establishes a data connection to WAP Gateway ^
Client sends WTAI (“
Wireless Telephony Application
Interface
”--HTTP for phones) request for URL entered
^
WAP Gateway receives request, decodes it ^
WAP Gateway sends HTTP request to Web Server ^
Web Server replies with content ^
WAP Gateway re-encodes content and sends it back to client ^
Client renders content locally
WML Syntax ^
^
^
^
title=“…” ^
id =“…” ^
newcontext =“true”, “false” ^
onenterbackward =“[url]” ^
onenterforward =“[url]” ^
ontimer =“[url]”
WML Syntax - Layout ^
^
align=“left”, “right”, center” ^
mode=“wrap”, “nowrap”
^
columns=“…” ^
align=“l”, “c”, “r” ^
^
Cell 1Cell 2Cell 3
WML Syntax - Images ^
- Render a WBMP file^
src=“…” ^
align = “top”, “middle”, “bottom” ^
alt=“…” ^
height=“…”, width=“…” ^
hspace=“…”, vspace=“…”
An image:
WML Syntax - Navigation ^
As in HTML, you link from page to page explicitlywith
anchors
This is a link
WML offers the tag and the tag
- the simple anchor tag^
href=“…”
- more powerful anchor tag^
, , , , ...
WML Syntax - Navigation ^
- Navigate to a new card
- Back up one on the card stack
- Reloads the current page
- Do nothing
- Sets a variable
- Sends a
post
(or
get
) field value to
the server
WML Syntax - Events ^
is the softkey event handler.
is a more generalised events handler.^
type=“onenterbackward”, “onenterforward”, “onpick”, “ontimer”
Use onevent to process data differentlydepending on the action of the user.
For example, you might want to initialise avariable to zero with onenterforward, but thenincremement it to track user returns inonenterback. Onenterback will fire whenever theuser uses the
prev
softkey to return to the page.
WML Syntax - Variables ^
A
variable
in a WML script is a data field whose
value can be changed before the next update.
This is a divergence from HTML.
HTML does not
have the concept of variables, because HTMLhas inline JavaScript instead.
Variable names, like all concepts in XML, arecase-sensitive.
To refer to a variable in your code, use a dollarsign ($) followed by the name of the variable,optionally enclosed in parentheses.^
$foo ^
$(foo)
WML Syntax - Variables ^
Variables are set with the tag.
Variables, once set, take effect when the page isnext reloaded. Unfortunately, since runs when an event triggers it, you can’t initialisevariables cleanly.^
WAP and WML - Recap ^
WAP architecture^
Client, WAP Gateway, Web Server
WML document structure^
DTDs, decks and ’s
WML syntax^
Basic document syntax - , , ... ^
Layout -
, ,
, ... ^
Text formatting - , , , , , ... ^
Images - - WBMPs only. ^
Navigation - , , ^
Events - ontimer, onenterforward, onenterbackward, ... ^
Variables - , , $(foo)
WAP and WML - Bibliography ^
WAP in Easy Steps, by Mike McGrath. (C)2000 published by ComputerStep, Warwickshire
http://www.w3schools.com/wap/wml_reference.asp
really well-done WML reference
http://developer.openwave.com/
who’re defining the WAP gateway standards. They alsomake a mobile device SDK.
http://www.openmobilealliance.org/documents.html
Technical specifications page for the Open Mobile Alliance,the public body which binds the many corporationsinvesting in WAP and related technologies.
Note: site can
be a bit thick