Programming the HTTP Protocol

< BACK  NEXT >
[oR]

Everyone uses the HTTP protocol when browsing the web. The protocol allows the browser to connect to a server and then make requests for resources (HTML, graphic files) to be downloaded. HTTP uses sockets for communications, and specifies the format and content of data being transferred. The protocol also allows data to be sent (or "posted") from the client to the server. However, the usefulness of HTTP is not limited to browsers. Applications you write for Windows CE can use HTTP to communicate data, with the following advantages over using sockets:

  • The Windows CE Internet functions provide a high-level API interface to program against.

  • The server-side socket code is already available in the Internet server (such as Microsoft Internet Information Server), and so multithreading code to support simultaneous access by many Windows CE devices does not need to be written.

  • The client can access any server-based data through the Internet server by running server-side code through Active Server Pages (ASP), web classes (written using Microsoft Visual Basic), or CGI (Common Gateway Interface).

  • Data can be received or sent using a standard file format (such as HTML or Text), or as binary data.

While it may at first seem strange to propose HTTP for communicating data, it is actually very versatile and convenient. You can use ASP pages with scripting code (written using Microsoft Visual Interdev) to access data directly through ADO (ActiveX Data Objects) or to use middle-tier COM components written using Microsoft Visual C++ or Visual Basic. The data does not have to be returned using HTML you can decide to return the data using a text file format (for example, XML or CSV) or a binary format (Figure 8.1).

Figure 8.1. Using HTTP to access enterprise data from Windows CE devices
graphics/08fig01.gif

< BACK  NEXT >


Windows CE 3. 0 Application Programming
Windows CE 3.0: Application Programming (Prentice Hall Series on Microsoft Technologies)
ISBN: 0130255920
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net