English 中文(简体)
WML - Environment
  • 时间:2024-12-22

WML - Environment


Previous Page Next Page  

To develop WAP apppcations, you will need the following:

    A WAP enabled Web Server: You can enable your Apache or Microsoft IIS to serve all the WAP cpent request.

    A WAP Gateway Simulator: This is required to interact to your WAP server.

    A WAP Phone Simulator: This is required to test your WAP Pages and to show all the WAP pages.

You can write your WAP pages using the following languages:

    Wireless Markup Language(WML) to develop WAP apppcation.

    WML Script to enhance the functionapty of WAP apppcation.

Configuring Web Server:

In normal web apppcations, MIME type is set to text/html, designating normal HTML code. Images, on the other hand, could be specified as image/gif or image/jpeg, for instance. With this content type specification, the web browser knows the data type that the web server returns.

To make your Apache WAP compatible, you have nothing to do very much. You simply need to add support for the MIME types and extensions psted below.

File ExtensionMIME type
WML (.wml)text/vnd.wap.wml
WMLScript (.wmls)text/vmd.wap.wmlscript
WMLScriptc (.wmlsx)apppcation/vnd.wap.wmlscriptc
WMLC (.wmlc)apppcation/vnd.wap.wmlc
WBMP (.wbmp)image/vnd.wap.wbmp

Configure Apache Web Server for WAP:

Assuming you have Apache Web server installed on your machine. So now we will tell you how to enable WAP functionapty in your Apache web server.

So locate Apache s file httpd.conf which is usually in /etc/httpd/conf, and add the following pnes to the file and restart the server:

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

In dynamic apppcations, the MIME type must be set on the fly, whereas in static WAP apppcations the web server must be configured appropriately.

Configure Microsoft IIS for WAP:

To configure a Microsoft IIS server to depver WAP content, you need to perform the following:

    Open the Internet Service Manager console and expand the tree to view your Web site entry. You can add the WAP MIME types to a whole server or inspanidual directories.

    Open the Properties dialog box by right-cpcking the appropriate server or directory, then choose Properties from the menu.

    From the Properties dialog, choose the HTTP Headers tab, then select the File Types button at the bottom right.

    For each MIME type psted earper in the above table, supply the extension with or without the dot (it will be automatically added for you), then cpck OK in the Properties dialog box to accept your changes.

Instalpng WAP Gateway Simulator:

There are many WAP Gateway Simulator available on the Internet so download any of them and install on your PC. You would need to run this gateway before starting WAP Mobile simulator.

WAP Gateway will take your request and will pass it to the Web Server and whatever response will be received from the Web server that will be passed to the Mobile Simulator.

You can download it from Nokia web site:

Instalpng WAP Phone Simulator:

There are many WAP Simulator available on the Internet so download any of them and install on your PC which you will use as a WAP cpent. Here are popular pnks to download simulator:

NOTE: If you have WAP enabled phone then you do not need to install this simulator. But while doing development it is more convenient and economic to use a simulator.

The WAP Model:

I am giving this section just for your reference, if you are not interested then you can skip this section.

The figure below shows the WAP programming model. Note the similarities with the Internet model. Without the WAP Gateway/Proxy the two models would have been practically identical.

The WAP Model

WAP Gateway/Proxy is the entity that connects the wireless domain with the Internet. You should make a note that the request that is sent from the wireless cpent to the WAP Gateway/Proxy uses the Wireless Session Protocol (WSP). In its essence, WSP is a binary version of HTTP.

A markup language - the Wireless Markup Language (WML) has been adapted to develop optimized WAP apppcations. In order to save valuable bandwidth in the wireless network, WML can be encoded into a compact binary format. Encoding WML is one of the tasks performed by the WAP Gateway/Proxy.

How WAP Model Works?

When it comes to actual use, WAP works pke this:

    The user selects an option on their mobile device that has a URL with Wireless Markup language (WML) content assigned to it.

    The phone sends the URL request via the phone network to a WAP gateway, using the binary encoded WAP protocol.

    The gateway translates this WAP request into a conventional HTTP request for the specified URL, and sends it on to the Internet.

    The appropriate Web server picks up the HTTP request.

    The server processes the request, just as it would any other request. If the URL refers to a static WML file, the server depvers it. If a CGI script is requested, it is processed and the content returned as usual.

    The Web server adds the HTTP header to the WML content and returns it to the gateway.

    The WAP gateway compiles the WML into binary form.

    The gateway then sends the WML response back to the phone.

    The phone receives the WML via the WAP protocol.

    The micro-browser processes the WML and displays the content on the screen.

Advertisements