Home arrow ASP arrow Page 2 - Introduction to WAP using WML, ASP and PHP

Introduction to WAP using WML, ASP and PHP

As technology changes, so do the tools that we use to manipulate it. Today the Internet is available from a number of devices, both connected and portable. In this article Jean shows us how to use the OpenWave SDK to create WML scripts. He also shows us how to configure IIS and Apache for WAP document requests.

Author Info:
By: Jean-Baptiste Minchelli
Rating: 5 stars5 stars5 stars5 stars5 stars / 73
February 22, 2002
  1. · Introduction to WAP using WML, ASP and PHP
  2. · Configuring IIS and Apache
  3. · Hello World in WMLScript
  4. · Generating WMLScript with PHP and ASP
  5. · Conclusion

print this article

Introduction to WAP using WML, ASP and PHP - Configuring IIS and Apache
(Page 2 of 5 )

When a web server receives a request for a document, it will retrieve that documents MIME type and append it to the returned document as part of its header information. These MIME types can be configured, and both IIS and Apache facilitate adding new MIME types.

WML (Wireless Markup Language) files make up the bulk of WAP content, and are plain text files that use markup tags in a similar way to HTML and XML. They contain the .wml file extension, and before we can request a WMLScript from our web server, the server needs to know its MIME type.

Let's now look at adding the necessary MIME types for both Apache and IIS.

For Apache

For Apache, you need to edit the httpd.conf file (which contains Apache's configuration directives) and add the following lines to the end of the file:

AddType text/vnd.wap.wml wml

AddType text/vnd.wap.wmlscript wmls

AddType application/vnd.wap.wmlc wmlc

AddType application/vnd.wap.wmlscriptc wmlsc

AddType image/vnd.wap.wbmp wbmp

The AddType directive tells Apache the details of the MIME types for files with specific extensions. The AddType directive is used like this:

AddType [MIME Type] [File Extension to map mime type to]

We've just added five new MIME types to Apache's httpd.conf file. If we now create a blank file called test.wml, then when we request this file through a WAP device, Apache will set the MIME type of that request to text/vnd.wap.wml, which indicates that the file contains WMLScript.

You'll need to restart Apache so that it recognizes our newly added MIME types.


Start the Microsoft Management Console (Start -> Run -> MMC) and load the IIS snap-in from the c:\winnt\system32\inetsrv\iis directory. Right click on the node that matches the name of your web server and choose the properties option.

Click on the edit button next to the master properties drop down box, select the HTTP Headers tab, and click on the file types button:

Click on the file types button to see the registered file types

This will load the registered file types dialog. Click on the new type button and create five new file types using the list shown below:
  • Associated extension: wml
  • Content type: text/vnd.wap.wml
  • Associated extension: wmls
  • Content type: text/vnd.wap.wmlscript
  • Associated extension: wmlc
  • Content type: application/vnd.wap.wmlc
  • Associated extension: wmlsc
  • Content type: application/vnd.wap.wmlscriptc
  • Associated extension: wbmp
  • Content type: image/vnd.wap.wbmp
Click OK three times to close all of the open dialogs, and then close MMC itself. You will need to restart IIS so that it picks up our newly added MIME types.

[Note] We don't have to set the MIME types for WAP content in IIS/Apache, and we can add the details of the MIME type manually to a script using by modifying its header information. [End Note]

Now that our Apache/IIS web server is ready to handle requests for WAP content, let's create a simple "hello world" script using WML and WMLScript.
blog comments powered by Disqus

- Central Scoreboard with Flash and ASP
- Calorie Counter Using WAP and ASP
- Creating PGP-Encrypted E-Mails Using ASP
- Be My Guest in ASP
- Session Replacement in ASP
- Securing ASP Data Access Credentials Using t...
- The Not So Ordinary Address Book
- Adding and Displaying Data Easily via ASP an...
- Sending Email From a Form in ASP
- Adding Member Services in ASP
- Removing Unconfirmed Members
- Trapping HTTP 500.100 - Internal Server Error
- So Many Rows, So Little Time! - Case Study
- XDO: An XML Engine Class for Classic ASP
- Credit Card Fraud Prevention Using ASP and C...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials