Network Programming in .NET: With C# and Visual Basic .NET

Not all HTTP clients are PCs. Many people use their mobile phones to access the Internet. Some applications are infinitely more useful when available wirelessly. Even though mobile phones ferry data in a totally different way from wired networks, a wireless application protocol (WAP) phone will communicate via a WAP gateway, which converts mobile phone signals into TCP/IP and accesses servers in much the same way as browsers.
WAP runs over HTTP and wireless transfer protocol (WTP), with a few extra headers thrown into the HTTP request. The following is a sample HTTP request generated by a WAP phone:
GET / HTTP/1.1Accept-Charset: ISO-8859-1Accept-Language: enContent-Type: application/x-www-form-urlencodedx-up-subno: Fiach_hopx-upfax-accepts: nonex-up-uplink: nonex-up-devcap-smartdialing: 1x-up-devcap-screendepth: 1x-up-devcap-iscolor: 0x-up-devcap-immed-alert: 1x-up-devcap-numsoftkeys: 3x-up-devcap-screenchars: 15,4Accept: application/x-hdmlc, application/x-up-alert,application/x-up-cacheop, application/x-up-device,application/x-up-digestentry, text/x-hdml;version=3.1, text/x-hdml;version=3.0, text/x-hdml;version=2.0, text/x-wap.wml,text/vnd.wap.wml, */*, image/bmp, text/htmlUser-Agent: UP.Browser/3.1-ALAV UP.Link/3.2Host: 127.0.0.1:50
| Note | x-up-subno is set to the computer username followed by the computer name. |
WAP clients and PC browsers differ most in the response. WAP clients cannot read HTML and use a simpler language, wireless markup language (WML), which has a MIME type text/vnd.wap.wml.
A minimal page in WML is as follows:
WML!doctype> Title
body
To view this page on a WAP phone, save the above text to index.wml. Ensure that the MIME type is registered on your computer by adding a registry key to HKEY_CLASSES_ROOT\.wml named Content Type with the value text/vnd.wap.wml.
Run the server as described in the previous section, and copy index.wml into the HTTP root...