" TYPE="text/css">

More about the Data Entry and Report Example

More About Html    More About WML    More About Web Services

The WAP / WML Samples

In addition to providing standard HTML services to internet browsers, web applications can be used with Wireless clients using WAP (Wireless Application Protocol). WAP clients, the most common being cellular phones, use the WML as their markup language. WML is a markup language similar to HTML. It was specifically created to support wireless devices. WML is based on XML.

Order Entry contains a simple WML example that allows you to list customers on your cell-phone, view customer data and to edit customer data (add, edit, delete). If a WAP device accesses this sample  (http://localhost/Order Entry), it will recognize that this is a WAP client and redirect the page to the WAP samples. In addition a couple of sample WML pages are provided to give you an idea of how WML works.

Getting Started

Before you build WML pages you are going to need to learn more about WML and the limitations of WAP devices  There are numerous good sources for this. We suggest you visit the phone.com web site (http://updev.phone.com) and download the SDK development kit. The kit contains very good documentation on WAP in general and on the WML language in particular. It also contains a phone simulator. This allows you run a WML phone simulator on your computer. Other phone simulators are available - and you definitely want to have at least one. Downloading the SDK kit is free although it does require registration.

The Opera browser (http://www.opera.com) also provides limited WML support. This browser can be downloaded for free and is worth using.

You cannot use the Microsoft IE browser to test your WML pages.

You will probably need to add WAP/WML mime types on you web server. The following information must be added to your IIS web server.

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

If you've got a phone simulator or the Opera Browser you can test if your web server is properly supporting WML by accessing the test page Wml-Sample-1.wml (e.g. http://localhost/Order Entry/Wml-Sample-1.wml). If this sample is not working, your other samples will not work.

Basic WML Examples

We've provided several samples to give you an idea of what WML pages look like. You are encouraged to review this source code and to try running these inside your phone simulator. Most of these samples pages are static and are therefore not the type of pages you will be using in a typical web application where the WML pages will almost always be created dynamically. Also included are two application samples, where the WML pages are generated dynamically.

The basic samples are:

Wml-Sample-1.wml

This is as simple as it gets. This creates a "Hello World" type of WML page.

Wml-Sample-2.wml

This sample was created to give you an idea of what a WML report might look like. This uses the WML <select> and <option> tags to create the report. You would rarely ever create a static page like this. Instead, you would use Visual DataFlex Web Application Server to generate a report like this dynamically (which is exactly what the WAP Report wizard does and is what the WAPCustList sample does).

Wml-Sample-3.wml

This sample was created to give you an idea of what a WML Display form might look like. Normally a page like this would be generated dynamically  (which is exactly what the WAP Entry wizard does and is what the WAPCustList sample does). The results of that dynamic generation would look like this page.

Wml-Sample-4.wml

This sample was created to give you an idea of what a WML input form might look like. It uses the WMLl <input> tag to generate the input controls. Normally a page like this would be generated dynamically  (which is exactly what the WAP Entry wizard does and is what the WAPCustList sample does). The results of that dynamic generation would look like this page.

Wml-Sample-5.asp

Unlike the other samples, this uses an ASP page which dynamically creates the WML page. This sample was created by loading the WML template sample. It contains the basics of needed to build a dynamic WML page.

The WML Application Examples

Below is a list of the WML components that are used as part of WebAppSample10. It might be worth nothing that these samples can be created, literally, in minutes using the Visual DataFlex Web Application Server WAP generation wizards.

As you use a phone simulator (or a real wireless device) to test these samples you will want to load the Visual DataFlex Studio, load the source files and study these examples.

Default.asp and WAPDefault.asp

The Default.asp page,  which is the default page accessed when this web site is requested contains code that checks to see if the requesting client is a WAP client. If it is, the page is redirected to WAPDefault.asp. This lets the same Web Site be used for different types of clients. WAPDefault.asp should contain the default display page for a WAP request. In this example, it redirects the request to WAPCustList.asp.

The Default.asp page can be added, unchanged to any web application. The WAPDefault.asp page, which will get called for WAP requests, must be customized as required.

WAPCustList.asp and WAPCustList.WO

This ASP page is requested when you wish to display a list of customers. It is used to initialize the report (select the index), seed the report (determine which record to start at) and to generate the report, which is accomplished by making a call to the oWAPCustList WO. 

This sample is generated entirely by Visual DataFlex Web Application Server's WAP Report generation wizard. These components are used in conjunction with the entry components, WAPCustomerMaint.asp and WAPCustomerMaint.WO.

WAPCustomerMaint.asp and WAPCustomerMaint.WO

This ASP page is requested when you wish to display, edit or delete customer data. The ASP page contains the presentation logic and the oWAPCustomerMaint WO is used to handle all business logic (find records, save new records, edit records, find records, delete records).

This sample is generated entirely by Visual DataFlex Web Application Server's WAP Entry generation wizard. These components are used in conjunction with the report components, WAPCustList.asp and WAPCustList.WO.

Note that the WO, oWAPCustomerMaint is identical to the WO created by the Customer Entry HTML page (oCustomer). Had we wished, a single WO could be used to provide all services for both HTML and WML pages (after all this is business logic, which should be independent of display). We created two separate WOs to keep the samples clear.

Finally, note that this single sample application provides HTML, WML and XML services.

More About Html    More About WML    More About Web Services