WAP/WML (DO NOT USE)
  Home arrow WAP/WML (DO NOT USE) arrow Page 2 - Introduction to WAP using WML, ASP and PHP
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WAP/WML (DO NOT USE)

Introduction to WAP using WML, ASP and PHP
By: Jean-Baptiste Minchelli
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 8
    2004-04-13

    Table of Contents:
  • Introduction to WAP using WML, ASP and PHP
  • Configuring IIS and Apache
  • Hello World in WMLScript
  • Generating WMLScript with PHP and ASP
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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.

    For IIS

    Start the Microsoft Management Console (Start -> Run -> MMC) and load the IIS snap-in from the c:winntsystem32inetsrviis 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.

    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.

    More WAP/WML (DO NOT USE) Articles
    More By Jean-Baptiste Minchelli


     

    WAP/WML (DO NOT USE) ARTICLES

    - Introduction to WAP using WML, ASP and PHP
    - Introduction to Wireless Access Protocol







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek