WAP Applications
1.1.1 WAP HISTORY WAP could roughly be described as a set of protocols that has inherited its characteristics and functionality from Internet standards and standards for wireless service developed by some of the worlds leading companies in the wireless telecommunications. In 1995 Ericsson initiated a project which purpose was to develop general protocol or rather a concept, for value added services on mobile networks. The protocol was named Intelligent Terminal Transfer Protocol (ITTP). During 1996,1997 Unwired Planet, Nokia and others, launched additional concepts in the area of value added services on mobile networks. In March 1997 Nokia officially presented the Smart Message Concept, an Internet access service technology specially designed for handheld GSM devices .The communication between the mobile users and the server containing Internet information using SMS and a markup language called Tagged Text Markup Language (TTML). With a multitude of concepts there was a substantial risk that the market could become fragmented. Therefore the companies agreed to bring forth a joint solution. WAP was born.
Dept. of CSE Narayana Engg. College, Nellore
2
WAP Applications
1.1.2 WAP FORUM
The WAP Forum was created by Nokia, Phone.com, Ericsson and Motorola in 1997.With the advent of WAP Forum Phone.com shared its knowledge and its partnership soon evolved into the now all- encompassing WAP specifications that include complimentary application, then session, transaction, security and transport protocol layers. The new markup language called the Wireless Markup Language (WML) has also been created. WAP Forum is opened to all and today over 90 companies are membership of WAP forum. The main objectives of WAP Forum are: 1) Independent of wireless network standard. 2) Open to all. 3) Will be proposed to the appropriate standards bodies. 4) Applications scale across transport options (GSM, IS – 95, IS – 136,PDC, etc). 5) Applications scale across device types(mobile phones, PDAs, etc). 6) Extensible overtime to new networks and transport(ex-3G systems).
1.1.3 TECHNICAL TERMS Dept. of CSE Narayana Engg. College, Nellore
3
WAP Applications
WAP Device: The physical device used to access WAP applications and content. Example: Mobile Phone, PDA or a Handheld computer. WAP client: The client is the entity that receives content from the Internet via the WAP gateway. That is usually the WAP browser. WAP browser: This is the software running on the WAP device that interprets the WAP contents arriving on the Internet and decides how to display it on the screen of the WAP Device. These are frequently referred to as Micro Browsers. User Agent: The software that deals with protocols. WAP client contains two different agents, the WAE User Agent and the WTA user Agent. WAP Gateway: This is the element that sits logically between the WAP device and the origin server. It acts as an ‘interpreter’ between the two enabling them to communicate. It usually resides within the operator network. Network Operator: This is the company or organization that provides career services to its subscribers. Bearer Services: These are the different ways that a mobile phone can communicate with the wireless network. To send and receive data from an application server, mobile phones have to establish some sort of connection with the gateway. A bearer service is a method used to do this. In GSM networks, either SMS (Short Message Service) or CSD (Circuit Switched Data) is used. Content/Origin/Application Server: They denote the element that hosts the Internet contents that is sent to the client and they make a request for it.
1.2 WAP INTERNAL STRUCTURE Dept. of CSE Narayana Engg. College, Nellore
4
WAP Applications
The WAP stack has five different layers.
WAP Application Environment (WAE): The application layer of WAP provides an environment that includes all the elements related to the development and execution of applications. WAE allows the developer to use the specific formats and services, created and optimized for presenting content and interacting with limited capability devices.
Wireless Session Protocol (WSP): WSP is an interface between WAE and rest of the protocol stack. WSP is the binary version of HTTP 1.1 with additions such as •
Capability negotiation
•
Header caching
•
Long lived sessions
Dept. of CSE Narayana Engg. College, Nellore
5
WAP Applications
•
Push
It includes two different protocols: Connection oriented session services-operates over the Wireless Transaction Protocol(WTP) Connectionless session services-operates directly over the Wireless Transport layer(WTP).
Wireless Transaction Protocol (WTP): The WTP provides services to accomplish reliable and non-reliable transactions and operates over the WDP layer or over the optional security layer. It is responsible for the control of transmitted and received messages. WTP works with three different message classes. •
Unreliable “send” with no result message No transmission if sent message is lost.
•
Reliable “send” with no result message The recipient acknowledges the sent messages. Otherwise the message is resent.
•
Reliable “send” with reliable result message (three way communication) A data request is sent and the result is received which finally is acknowledged by
the initiating part.
Wireless Transport Layer Security (WTLS): The purpose of WTLS is to provide transport layer security between the WAP client and the WAP Gateway/Proxy. WTLS is based on Transport Layer Security Dept. of CSE Narayana Engg. College, Nellore
6
WAP Applications
(TLS) 1.0 but optimized for narrowband communication channel. The key features include •
Integrity through the use of Message Authentication Codes (MAC).
•
Confidentiality through the use of encryption.
•
Authentication and non- repudiation of server and client using digital certificates. These features make possible to certify that the sent data have not been manipulated by a third party, that privacy is guaranteed, that an author of a message can be identified and that both parties cannot falsely deny having sent their messages. As shown in the diagram the standard SSL session is opened up between the web server and the WAP gateway and a WTL session is initialized between the gateway and the mobile device. The encrypted content is sent through this connection from the server through the gateway, which translates it and sets it to the mobile phone. WTLS is optional and can be used with both the connectionless and the connection mode WAP stack configuration if used it is always placed on the top of WDP.
Wireless Data gram Protocol (WDP): WDP is the bottom layer of the WAP stack and is one of the elements that makes WAP, the extremely portable protocol that is, operable on extremely different mobile networks. WDP shields the upper layers from the bearer services provided by the network, so allowing the applications a transparent transmission of data over the different bearers. It is also possible to extend WDP with an optional protocol for error reporting called Wireless Control Message Protocol (WCMP). This protocol can be used when WAP is not used on a IP bearer (IP has its own control message protocol). WCMP can also be used for informational and diagnostic purposes.
Dept. of CSE Narayana Engg. College, Nellore
7
WAP Applications
Dept. of CSE Narayana Engg. College, Nellore
8
WAP Applications
COMPARISON BETWEEN THE INTERNET & WIRELESS APLLICATION PROTOCOL
Dept. of CSE Narayana Engg. College, Nellore
9
WAP Applications
1.3 WIRELESS MARKUP LANGUAGE (WML) The wireless markup language is WAP analogy to HTML. WML is based on the extensible markup language (XML). WML uses a deck /card metaphor to specify a service. A card is typically a unit of information from the user. A collection of cards is called a deck, which usually constitutes a service. The approach ensure that a suitable amount of information is `displayed to the user simultaneously since inter-page navigation can be avoided to the fullest possible extent. Key features of WML include: •
Variables
•
Text Formatting features
•
Support for images
•
Support for soft-images
•
Navigation control
•
Control of browser history
•
Support for event handling (for e.g. telephony services)
•
Different types of user interactions, e.g. selection lists and input fields
WML can be binary encoded by the WAP gateway/proxy in order to save bandwidth in the wireless domain.
Dept. of CSE Narayana Engg. College, Nellore
10
WAP Applications
Every WML deck starts with the same XML header: XML version=”1.0” ?>
THE HEADER The first line of this simply states that what follow is an XML documents and the version number used . The next line selects the document type and gives the URL of the Document Type Definition. This DTD gives the full XML definition of WML.
THE BODY The WML, code of a deck is enclosed in the <wml> tag pair. This is the body of the document , and the cards are defined within it using the tag pair. This tag pair is our first encountered with attributes in WML. The id attributes gives a unique ID for this card within the deck, while the title attribute often describes the card and may be displayed by the browser:
Dept. of CSE Narayana Engg. College, Nellore
11
WAP Applications
1.3.1 VALID WML ELEMENTS
Dept. of CSE Narayana Engg. College, Nellore
12
WAP Applications
1.4 ACTIVE SERVER PAGES Active Server Pages (ASP) is a great tool for creating dynamic web pages. ASP is a Microsoft technology, and it works by allowing us the functionality of a programming language, we write programming code that will generate the HTML for a web page dynamically. So whenever a user browses a website and requests one of the ASP pages, ASP code is processed at that time by a special piece of software – a web server. This processing generates the WML, which is then passed to the browser and used to create the page itself, on the user screen.
The power of ASP lies in following facts: •
The WML is not created until the user wants to see the web page.
•
It does not matter what the micro browser is being used.
•
ASP customizes our web pages to the specific needs of each individual user because of its ability to create pages that are sensitive to factors such as time and place, and the users identity and previous choices and actions.
•
ASP is a great way to bring the best features of programming to web pages.
ASP is different from many Microsoft technologies in the following respect while ASP must be executed on a computer that supports it, we can view ASP driven web pages from any computer or mobile and with any modern browser. ASP was officially announced to the world by Microsoft on July 16, 1996, code named Denali. A beta version was released in November 1996, and ASP version 1.0 was shipped on Dec 12, 1996. It has gained much wider recognition when it was bundled with version 3.0 of Microsoft’s Internet Information Server (IIS) – a web server in March 1997 and it has been gaining popularity since then. Dept. of CSE Narayana Engg. College, Nellore
13
WAP Applications
With release of Windows 2000, the IIS was further updated to version 5.0 and new version of ASP (3.0) was also released. Moreover IIS - 5.0 is naturally integrated with Windows 2000 operating system, resulting in a more streamlined overall package.
ASP CODE IS BROWSER – INDEPENDENT ASP code is executed on the web-server, and generates pure WML, the client machine doesn’t need to provide any kind of ASP support at all. In fact, the web-browser handles .wml pages and .asp pages in exactly the same way – because from the browser’s point of view, the process involves sending a page request to a web server and receiving a stream of pure WML.
Advantages of using a server side technology is: •
Programs can be run in programming languages that aren’t supported by your browser.
•
Browser – independent dynamic web applications can be programmed, without recourse to client-side programming features such as Java Applets, Dynamic HTML, Active – X controls, all of which are browser specific.
•
Can provide the client (browser) with data that does not reside at the client.
•
Often makes for quicker loading times than with client-side Dynamic web technologies such as Java Applets or Active-X controls, because in the end, you are actually only downloading a page of HTML.
•
Provides improved security measures, since we can write code, which can never be viewed, from the browser.
Dept. of CSE Narayana Engg. College, Nellore
14
WAP Applications
SOFTWARE REQUIRED TO RUN ASP •
In order to write pages, we’ll need a text editor or other web development tool. Notepad works fine for this purpose, but there are plenty of other editors on the market.
•
In order to publish the pages, we’ll need a web-server that supports Active Server Pages.
•
In order to view and test the pages we’ll need a web browser! As we mentioned before, ASP is processed on the web-server, not on the browser-this means that any browser should suffice. ASP page is composed of a combination of three types of syntax-some parts of
ASP, some parts of WML tags and some parts of text. All this constituent parts of the ASP page are saved on a file with .asp extension.
The following table summarizes these three ingredients, and their purpose and their appearance. TYPE TEXT
PURPOSE Hard-coded
INTERPRETER Viewer’s browser
information to be
on their mobile
shown to the user. Instruction to the
shows the text. Viewer’s browser
Each tag within <
micro browser
on their mobile
> delimiters. Most
about how to
interprets the tags
WML
format text and
to format the text.
pairs.
ASP
display images. Instructions to the
Website host’s
Each ASP section
STATEMENTS
web server
web server
is contained within
WML TAGS
HALLMARKS Simple ASCII text.
tags come in
running ASP about software with asp
<% %>
how to create
delimiters. ASP
extensions
portions of the perform the Dept. of CSE Narayana Engg. College, Nellore
statements 15
WAP Applications
page to be sent
instructions of the
out.
ASP
Code.
contains the structure of more traditional programming languages such as Visual Basic and Java as they have features such as variables, decision trees, cyclical repetitions.
ASP INTRINSIC OBJECTS
Dept. of CSE Narayana Engg. College, Nellore
16
WAP Applications
There are seven ASP intrinsic objects, which deal with a specific aspect of interactivity: they are called request, response, server, application, session, ASP error and object context. The request and response objects are, in a sense, the most self-explanatory. They represent the movement of information from client-to-server and from server-to-client. •
The request object is used to deal with a request that a user makes- that is, when they ask the browser to see a particular web page or web application. The ‘request’ might be made in the form of input from an HTML form, or just by typing in a URL.
•
The response object is used to deal with the server’s response back to the browser.
The functionality for writing into the HTML output is encapsulated into the method called write-which, logically, is contained within the response object.
The other objects work more in the background to further enhance the functionality available in ASP.
•
The server object is used to represent the web-server itself. Thus, it provides several commonly used functions relating to things that the web-server might dosuch as creating new objects and setting time-out properties for scripts. There are also methods for translating character strings into the correct format for use in URL’s and in HTML, by converting the non-legal characters into the correct legal equivalent.
•
The application object is used to represent the web application (roughly speaking, a collection of related web pages posted by the web server). Thus, we can used to manage things like the contents of the application.
•
The session objects used to represent the users session (essentially, the ‘experience’ that the user has while browsing a number of pages with in the same web applications), and to store information about that session. We use the
Dept. of CSE Narayana Engg. College, Nellore
17
WAP Applications
session object to manage things like the maximum time that the web-server will wait between user ‘requests’, before terminating the session (and releasing the information relating to that session). •
The object context object is used to manage transactions. It started out solely as part of ASP, but now has been integrated into the Windows 2000 operating system as a whole (along with Microsoft Transaction Server- a package with which it was closely related). It encompasses all of the other ASP objects, and you can reference each of them through object context.
•
ASP error object contains details of any errors generated by an ASP script or by the asp.dll itself.
REQUEST OBJECT Request object handles communication between the browser and the web server. It is central to the ASP object model, and is vital for controlling how the user sends information to the server. Using the request object the ASP code can obtain the information from the server what the server wants: this information can be manipulated within the ASP.
HANDLING BROWSER SERVER COMMUNICATION When a browser or a client application asks for a page from the web server, it is called a request. In order to make the request from a server, the client must supply the specific page using an address (URL): in addition the client can send a whole host of other information to the server. The request object is responsible for packing all this information and making it easily accessible to the ASP application.
Dept. of CSE Narayana Engg. College, Nellore
18
WAP Applications
object stores items that have been sent in a series of collection. The request object has five collections: •
Query String: When sending a request the client can include name/value pairs of information within the URL, after the filename. This collection stores any value provided in the URL.
•
Form: If the client sends the form request and sets the method attribute to post then values of the form element are stored in this collection.
•
Server Variables: Web server itself holds a great deal of information about the request contained in the HTTP server variables. This information is made available as a collection.
•
Cookies: If the client is accepting cookies from the server, it sends the information to the server, and the server stores it in cooking collection.
•
Client Certificate: A client certificate is a digital certificate exchanged between the client and the server to verify the identity of the user attempting to contact the server. If the client sends any security certificate to the server, then they are stored in this collection.
RESPONSE OBJECT
Dept. of CSE Narayana Engg. College, Nellore
19
WAP Applications
In order for the client to display the information, server needs a mechanism to relay the data back to the client. This is the job of the response object. The primary function of the response object is to send information to the client. This is the direct result of the client making a request of the server. With the response object, the ASP script can: •
Send information back to the client.
•
Control when to send information back to the client.
•
Tell the browser how long-or until when- to catch the contents of the page.
•
Tell the browser to go fetch another page.
•
Perform other functions with the information that is being sent back to the browser.
•
Instruct browser to create a cookie. The response object gives a very fine control over the information that is
returned to the client. For limitless flexibility, the response object provides other functions like •
Changing the content type of the response so that not only WML can be sent back to the client.
•
Detecting if the client making the request is still connected to the server. This allows the process to be abandoned, if the browser had moved onto another page.
•
Adding additional information to the log file entry that is made in the web servers log file. The write method of the response object will be the most used method. The
write method is used to display text on ASP page. <% Response.Write value %>
Dept. of CSE Narayana Engg. College, Nellore
20
WAP Applications
The other common methods are : •
Buffer property Is used to tell ASP that when the HTML output string is sent back to the browser it will manually controlled.
•
Flush method Sends any previously buffered output to the client immediately, but continuous processing the script this can be useful for displaying partial results.
•
Clear Clear method erases any already buffered WML.
•
Redirect method This method would tell the browser that it needs to go and fetch another deck/card. This deck/card would be on the completely different website.
1.5 ODBC(Open Database Connectivity): Dept. of CSE Narayana Engg. College, Nellore
21
WAP Applications
It is standard for accessing data. It was designed to allow the programmers to use a common set of routines to access the data stored in the database, regardless of the type of the database in which the data is stored.
Dept. of CSE Narayana Engg. College, Nellore
22
WAP Applications
Fig. ODBC Connectivity
OLE DB- OBJECT LINKING AND EMBEDDING DATABASE OBJECT
It is the next step in the evaluation of the anonymous data store. OLE-DB is faster and easier to use than ODBC. Eventually it may well replace ODBC. The following diagram begins to build up a picture of data access using OLE-DB.
Fig. OLE-DB Interface
ADO- ACTIVEX DATA OBJECTS ADO is the friendly face of OLEDB. ADO is the set of objects that allow the programming to program their data access their logic from language like VB as well as scripting languages. ADO is the higher-level model than OLE-DB. Dept. of CSE Narayana Engg. College, Nellore
23
WAP Applications
ADO layer sits nearly between the application itself and the OLE-DB layer.
Fig. ADO Object Model
Dept. of CSE Narayana Engg. College, Nellore
24
WAP Applications
ADO OBJECT MODEL As it can be seen from the diagram there are five main objects: •
Connection: The link between the program and the data store.
•
Command: Allows to run the commands against the data store.
•
Record set: Contains all the data returned from a specific action on the data store.
•
Record: Allows handling of the data kept in the semi-structured storage as though they were records in the database.
•
Stream: Allows the manipulation of data held in the data resources.
CONNECTION STRING : A connection string is a simple character string that lists all the information needed to connect the database. A typical connection string will contain some or all of the following key pieces of information (depending upon the type of the data store we are connecting to): •
Provider
•
Driver
•
Initial catalog
•
User id
Dept. of CSE Narayana Engg. College, Nellore
25
WAP Applications
•
Password
•
Persist Security Info
For example to connect to the SQL server “Provider = SQLOLEDB; Persist Security Info = false;” &_ “User ID = sa; Initial Catalog = airlinedb;” &_ “Initial File Name = C:\MSSQ7\airlinedb.mdf”
CONNECTION OBJECT: The connection object is what the ADO uses to store our information about the data store connection. Infact , it actually represents a unique session with the data store.
CREATING CONNECTION TO THE DATABASE: The CreateObject method of the server object is used to create an instance of the connection object as follows: Dim objconn Set objconn =Server.CreateObject (“ADODB.Connection”)
OPENING A CONNECTION :
In order to actually establish the connection we use the open method of the objconn object. The syntax for using the open method is Objconn .open connectionstring, userid, password, options For example : Objconn.open “Provider =SQLOLEDB; Persist Security Info =false; Dept. of CSE Narayana Engg. College, Nellore
26
WAP Applications
User id =sa; Initial Catalog = airlinedb; Initial File Name=C:\MSSQ7 \airlinedb.mdf” Here we have only specified the first argument and the other arguments will assume default values.
CLOSING THE CONNECTION After we have finished with the connection it is closed in order to free the system resources as: Objconn.close This doesn’t actually remove the object from the memory. In order to do so we have to set Set Objconn = Nothing
RECORD SET OBJECT: It is the most heavily used ADO object used in the code. It is the set of records. An ADO record set uses cursor, the cursor is the ‘pointer’which points to exactly one of the records in the record set. The cursor is useful for navigating through the retrieved records.
CREATING A RECORD SET : The record set object is created as Set objrs= Server.createobjrect(“ADODB.Recordset”) The most obvious way to get some data from a data store is to explicitly create an ADO connection object in our code, and then use the connection object’s properties when working with recordset: Dim strconn, objconn, objrs Dept. of CSE Narayana Engg. College, Nellore
27
WAP Applications
Strconn= “Provider= Microsoft.Jet.OLEDB.4.0; &_ Datasource= c:\airlinedb.mdb” Set objconn=Server.CreateObject(“ADODB.Connection”) Objconn.open strconn Set objrs=Server.CreateObject(“ADODB.Recordset”) Objrs.open “airline”, objconn
ADO objects enjoy a flat hierarchy , in which the independence of objects within the code is hidden in order to make the code simpler.
COMMAND OBJECT: Command objects provide much greater flexibility and functionality by allowing us to run complex queries – enabling us to make the most of the things like stored procedures and parameters . Command objects can be created by using create object method of the ASP server object. Set objcomm=Server.CreateObject(“ADODB.Command”) Command objects execute method id used to run a command. The execute method has three parameters:
Objconn.Execute RecordsAffected, Parameters, options All the three arguments are optional – omitting any one of them will result in adopting the default value. The parameters are: •
RecordsAffected parameter is for action queries.
•
Parameters parameter holds an array of parameters that are to be passed to the command.
Dept. of CSE Narayana Engg. College, Nellore
28
WAP Applications
•
Options parameter specifies the command being run.
Dept. of CSE Narayana Engg. College, Nellore
29