Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..
SYS-CON.TV
Today's Top SOA Links


No Strings Attached
No Strings Attached

But all that is about to change. Wireless computing has finally come of age, and you, as a ColdFusion developer, are poised to take a leading role in wireless application development. Want to take a ride into the not-so-distant future? Read on.

Why Wireless Computing?
Wireless computing is compelling. The image of being able to access data, e-mail, file systems - everything you need - with no strings attached (literally) is enough to make even the most serious technophobes drool. Just think of it: company data, stock quotes, e-mail, weather information, maps and directions, phonebooks, search engines, online stores - and all from the palm of your hand.

Yes, wireless is compelling. But there's another side to wireless - a far less compelling side: heavy devices, poor battery life, incompatible systems and carriers, lack of coverage and no standard way to access data.

Now, none of these issues is irresolvable. On the contrary, technology has reached a point where every one of these problems could be addressed. But doing so would require standards supported and adopted by all the major players in this space. And that's where the real news is.

Introducing WAP
WAP is the Wireless Application Protocol - an open specification designed to empower mobile users armed with wireless devices. WAP is managed by the WAP Forum (www.wapforum.org) - a nonprofit organization with members representing every major player in the wireless arena. From phone and PDA vendors to operating system providers and national and international carriers, WAP Forum is a virtual who's-who of the wireless world.

And that is significant. WAP will succeed where others have failed because anyone of any significance is backing it. And with members like AT&T, Cable & Wireless, Ericsson, HP, IBM, Intel, Lucent, Microsoft, Nokia, Oracle, Sprint, Sun and dozens of regional and national phone companies, one thing is for sure - WAP Forum has the clout and resources to make wireless a reality once and for all.

So what exactly is WAP? At its simplest, it's a data transport protocol, much like HTTP. Actually, WAP is based on HTTP - you can almost think of it as a form of HTTP optimized for wireless communication. But while HTTP is designed primarily for use by Web browsers in a highly connected environment, WAP is designed for wireless devices in a highly disconnected environment. WAP can run on every major operating system (just like HTTP), and it supports the wireless networks used by almost every major carrier.

WAP is designed to provide a fast, efficient and secure base on which to build applications for wireless devices. And not just PDAs. WAP is designed for use on cellular phones, pagers, two-way radios and a whole generation of devices that have yet to debut.

Yet Another Markup Language?
But WAP is only part of the story - and in all honesty it's the less interesting part. When you develop a Web application, you don't pay that much attention to HTTP (unless you're writing Web browsers or servers, which thankfully most of us don't have to do). What you really are interested in is HTML - the language used to actually create your sites and applications.

HTML is very graphic oriented, and I don't mean just the <IMG> tag. Tables, frames, style sheets - most of what we do in HTML is oriented toward visual representation on a computer monitor. And that makes HTML rather useless on wireless devices. In case you thought otherwise, wireless devices don't have 17-inch monitors attached (thank goodness). Most of them have really small screens, capable of displaying a few lines of text and perhaps really simple icons and graphics. In addition, they don't have the processing power, storage and bandwidth to display typical Web pages.

And so WAP leverages a new XML-based markup language - WML, or Wireless Markup Language. WML is a tag-based language, just like HTML. But instead of featuring tags designed to build complex and detailed displays, WML tags are used to build lists, process simple data entry and even reprogram device buttons on a page-by-page basis.

WML pages are displayed using special browsers called microbrowsers. These are special combinations of hardware and software designed specifically for use in devices with extremely small form factors. One of the best known microbrowsers is produced by Allaire partner Phone.com (the URL for their home page is at the end of this column).

To give you a taste for WML, take a look at the example in Listing 1.

Without going into all the details, this code creates a simple list with three choices, each associated with a URL. Users can select one of the options (using arrow keys, phone buttons or some other form of selection) to jump to specific pages. Unlike HTML files, WML files don't equate to pages. A single WML may contain multiple pages called cards. WML files are enclosed within <wml> and </wml> tags, and each file contains one or more cards. Using cards, it's possible to send multiple pages to the device simultaneously so that a connection to the server isn't needed for each page displayed.

You'll notice that WML shares many tags and attributes with HTML, but there are important language differences too. The example in Listing 2 creates a simple display showing weather information. The display contains a title followed by a table containing the day's high and low temperature values.

As you can see, WML supports paragraphs, tables, italics and even images. To improve application performance, WML supports downloaded images (specified using the <img> tag's src attribute) or local images (the localsrc attribute); the latter are all-purpose images (more like little icons and symbols) stored on the device - and there are lots of them. By using local images, the amount of data transferred over the wireless connection can be greatly reduced.

WML even supports client-side scripting using a language called WMLScript. While similar to JavaScript, it too has been optimized for microbrowsers and the kinds of operations you'd want to perform on them.

One thing important to note is that WML syntax is far stricter than that of HTML. You'll notice that every tag needs an end tag (or at least an XML-style end slash). In addition, no tags may be omitted (for example, the tag), and all tags and attributes must be lowercase (yep, WML is case sensitive).

Serving WAP Content
So, you've created WML pages. How do you serve them to client devices? HTTP requests are processed by HTTP servers, so WAP requests should be processed by WAP servers. Or so you'd expect.

The truth is, WAP content must indeed be served by a WAP server, but you don't need one of your own. WAP was designed so that content could be accessed using standard HTTP requests. This was a deliberate decision by the WAP specification authors, and one that greatly increases the viability of the spec. If we all needed new servers, WAP would never gain acceptance.

You can install a WAP server of your own if you'd like, of course, but typically you'd never want to. Rather, you'd serve up WML via HTTP and let the conversion between HTTP and WAP happen on another server called the WAP Gateway - a special piece of software that acts as a filter and adapter. And you wouldn't need your own WAP Gateway either - these are usually owned and hosted by the network carriers.

What this all means is that serving WAP content is pretty simple. The only thing you have to do is identify the content as being WML, and you can do that with a simple MIME type mapping. If you're serving static WML pages, you can usually make that association in the Web server configuration. The MIME type for WML is:

text/vnd.wap.wml

ColdFusion for Wireless
So what has all this to do with you and ColdFusion? Well, ColdFusion can deliver content for any client platform, including WML. To turn a page into a WML page, all you need to do is specify the MIME type, and in ColdFusion that's as simple as inserting the following code into your page:

<CFCONTENT TYPE="text/vnd.wap.wml">

Let's take another look at the weather example in Listing 2, but this time, instead of hard-coding the output, we'll generate it dynamically using ColdFusion (see Listing 3).

If the code looks somewhat familiar, that's because it is. Writing ColdFusion-powered WML is no different from writing ColdFusion powered HTML.

Of course, if you need to write in WML, watch out for case-sensitivity issues and convert your JavaScript to WMLScript. But that's not that complicated a process, and it's about to get even easier.

ColdFusion Studio 4.5 now has built-in support for WML. Not only are the tags listed in the Tag Chooser making learning the language easier, there's also a complete set of Tag Editors and page templates provided too. With ColdFusion Studio 4.5 WML development really is as easy as HTML development.

Conclusion
WAP and WML are real, and products built on these technologies are starting to appear. As a ColdFusion developer you already have the tools you need to take advantage of the opportunities offered by this new era.

So take the time to start experimenting with WML, it's easy - and fun. Just think how wonderful it would be to have full access to your systems and data from a wireless device and to be accessible to all who need you, anytime, anywhere. Wonderful. Or not.

Note: If you'd like to start writing and testing WML applications but don't have a WML device, download Phone.com's phone emulator (it comes with their SDK). You can get more info from www.phone.com.

About Ben Forta
Ben Forta is Adobe's Senior Technical Evangelist. In that capacity he spends a considerable amount of time talking and writing about Adobe products (with an emphasis on ColdFusion and Flex), and providing feedback to help shape the future direction of the products. By the way, if you are not yet a ColdFusion user, you should be. It is an incredible product, and is truly deserving of all the praise it has been receiving. In a prior life he was a ColdFusion customer (he wrote one of the first large high visibility web sites using the product) and was so impressed he ended up working for the company that created it (Allaire). Ben is also the author of books on ColdFusion, SQL, Windows 2000, JSP, WAP, Regular Expressions, and more. Before joining Adobe (well, Allaire actually, and then Macromedia and Allaire merged, and then Adobe bought Macromedia) he helped found a company called Car.com which provides automotive services (buy a car, sell a car, etc) over the Web. Car.com (including Stoneage) is one of the largest automotive web sites out there, was written entirely in ColdFusion, and is now owned by Auto-By-Tel.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE