Creating WAP Documents
WAP (Wireless Application Protocol) is a protocol that allows wireless devices access to information and services over the Internet. WAP makes it possible to deliver Web content through a WAP gateway server directly to a wireless Web-enabled device. By using already existing Internet technology such as XML and IP, WAP allows access to Internet content and services to wireless clients. With WAP, clients can obtain Internet content and services through devices such as, mobile phones, PDAs, pagers, two-way radios, smart phones, communicators, and terminals. The protocol is developed by WAP Forum, an organization of some of the most powerful Internet and telecom companies.

Configuration

It is quite easy to enable a Virtual Server web server to serve WAP (Wireless Application Protocol) documents. The gateway is usually on the cellular network, so all that your web server needs are the correct MIME Types.

1. Connect to your Virtual Server via Telnet or SSH and use an online editor, like pico, to open your web server configuration file (~/www/conf/httpd.conf). Or, download your web server configuration file via FTP, making sure to download (and upload) in ASCII format. Then make the following additions to the configuration file.

   > AddType text/vnd.wap.wml .wml
   > AddType image/vnd.wap.wbmp .wbmp
   > AddType application/vnd.wap.wmlc .wmlc
   > AddType text/vnd.wap.wmlscript .wmls
   > AddType application/vnd.wap.wmlscriptc .wmlsc

2. You might also want to add index.wml to the DirectoryIndex directive, like this:

   > DirectoryIndex index.wml index.html

Testing

Create a ~/www/htdocs/hello.wml test file to verify that you've set things up right. The following sample code show how to create two sample cards using Wireless Markup Language (.wml).

> <?xml version="1.0"?>
> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
> "http://www.wapforum.org/DTD/wml_1.1.xml">
> <wml>
> <card id="card1" title="My Wap Page">
> <p>Hello world - this is my first wap card!</p>
> <p><a href="#card2">Go to the second card</a></p>
> </card>
> <card id="card2" title="Second Card">
> <p>This is my second wap card!</p>
> <p><a href="#card1">Go back to the first card</a></p>
> </card>
> </WML>

When you develop WML pages, you should always check the page in one of the SDKs available.

- Nokia WAP Developer Tools
- Ericsson Developers Zone
- Phone.com UP.SDK

In order to view your new WAP document, you need a WAP-enabled cell phone or a WAP emulator. There are many WAP emulators available, including these:

- Wapalizer - WAP Browser
- WapTiger - Java WML-to-HTML converter

More Information

For more information and resources see the following.

- Wap.com - Your guide to the wireless Internet
- Gelon.net - WAP resources
- WAP Resources - The WAP developers network
- WapTiger WBMP Converter - Convert BMP files to WBMP
- Zygo Communications WAP Tools - XML verifier, and more
- Test routines for WAP phones