WML - Environment

Advertisements


To develop WAP applications, you will need the following:

  • A WAP enabled Web Server: You can enable your Apache or Microsoft IIS to serve all the WAP client 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 application.
  • WML Script to enhance the functionality of WAP application.

Configuring Web Server:

In normal web applications, 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 listed below.

File ExtensionMIME type
WML (.wml)text/vnd.wap.wml
WMLScript (.wmls)text/vmd.wap.wmlscript
WMLScriptc (.wmlsx)application/vnd.wap.wmlscriptc
WMLC (.wmlc)application/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 functionality in your Apache web server.

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

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

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

Configure Microsoft IIS for WAP:

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

  1. 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 individual directories.
  2. Open the Properties dialog box by right-clicking the appropriate server or directory, then choose Properties from the menu.
  3. From the Properties dialog, choose the HTTP Headers tab, then select the File Types button at the bottom right.
  4. For each MIME type listed earlier in the above table, supply the extension with or without the dot (it will be automatically added for you), then click OK in the Properties dialog box to accept your changes.

Installing 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:

Installing 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 client. Here are popular links 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 client 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 applications. 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 like this:

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

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

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

  4. The appropriate Web server picks up the HTTP request.

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

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

  7. The WAP gateway compiles the WML into binary form.

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

  9. The phone receives the WML via the WAP protocol.

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



Advertisements
Advertisements