Before we describe WAP model, first we would like you to understand how Standard Internet works.
The Internet model makes it possible for a client to reach services on a large number of origin servers, each addressed by a unique Uniform Resource Locator (URL).
The figure below shows how a WWW client request a resource stored on a web server. On the Internet standard communication protocols, like HTTP and Transmission Control Protocol/Internet Protocol (TCP/IP) are used.
The content available at the web server may be static or dynamic. Static content is produced once and not changed or updated very often; for example, a company presentation. Dynamic content is needed when the information provided by the service changes more often; for example, timetables, news, stock quotes, and account information. Technologies such as Active Server Pages (ASP), Common Gateway Interface (CGI), and Servlets allow content to be generated dynamically.
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.
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.
When it comes to actual use, WAP works as follows −
The user selects an option on their mobile device that has a URL with Wireless Markup language (WML) content assigned to it.
The phone sends the URL request via the phone network to a WAP gateway using the binary encoded WAP protocol.
The gateway translates this WAP request into a conventional HTTP request for the specified URL and sends it on to the Internet.
The appropriate Web server picks up the HTTP request.
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.
The Web server adds the HTTP header to the WML content and returns it to the gateway.
The WAP gateway compiles the WML into binary form.
The gateway then sends the WML response back to the phone.
The phone receives the WML via the WAP protocol.
The micro-browser processes the WML and displays the content on the screen.