Software System Construction:Wireless application protocol (WAP)

10.7 Wireless application protocol (WAP)

As we discussed in chapter 2, the wireless access protocol (WAP) allows Internet content to be delivered to a mobile device, such as a phone. The wireless application protocol (WAP) deals with the transfer of data between a wireless device (such as a mobile phone) and a WAP gateway that can then use the hypertext transfer protocol (HTTP) to request services from web servers (figure 10.18). However, given the limitations of mobile telephones and WAP,

rather than format content using HTML, WAP uses WML – wireless markup language – to format content for display on a mobile phone. A WML file is known as a deck, and contains one or more cards, where each card is a screen of information analogous to a web page on a web site.

10.6.1 Generating wireless content with ColdFusion

Before WML content can be accessed on a mobile device the web server must be configured to deal with requests for WML files. This is a simple task for the web server administrator and most Internet service providers will have configured their servers for WML, giving their customers free access to WML services. Files of content marked up using WML for delivery to a mobile device will normally have the extension '.wml', e.g., 'hello.wml'. Using ColdFusion we can serve up WML content to mobile devices from a database, just as we have already done for content targeted at HTML in a traditional PC browser.

Developing Web Information Systems-0125

The ColdFusion server only looks at files with the extension 'cfm'. Therefore, mobile content must be in a file with a cfm extension. In order that the web server knows how to handle the wml content produced by ColdFusion the <CFContent> tag is used. This tag tells the web server that the content is WML rather than HTML. The following example shows how a ColdFusion template, mobile.cfm, can generate WML content from a database.

<cfcontent TYPE="text/vnd.wap.wml"> <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card id="Home"> <p> <cfoutput> #DateFormat(Now(),"dddd dd mmm, yyyy")#<br/> </cfoutput> <cfquery datasource="mydatabase" name="production"> select * from qryProduction order by fldProductionTitle </cfquery> <cfoutput query="production"> #fldTheatreName#:<br/> #fldProductionTitle#<br/> </cfoutput> </p> </card> </wml>

Developing Web Information Systems-0126

www.wisdm.net/theatre/mobile.cfm on a WAP emulator (www.gelon.net) As with the generation of HTML for a desktop browser, a CFQUERY tag is used to query the database to get a list of productions and CFOUTPUT is used to cycle through the record set 'production' outputting the theatre name and production title. We have also added a CFOUTPUT at the start of the deck to output the date and time. The output from mobile.cfm is shown in figure 10.19, which is produced using the gelon.net emulator on a PC browser. To see the theatre on a WAP phone create a bookmark on your mobile phone:http://www.wisdm.net/theatre/mobile.cfm.

Comments

Popular posts from this blog

The Conversion Cycle:The Traditional Manufacturing Environment

The Revenue Cycle:Manual Systems

Nassi-Shneiderman charts