Describe a Web services application.?

Question by Yuchieh4638: Describe a Web services application.?
Describe a Web services application for monitoring the clarity of water of lakes in Minnesota. The Department of Natural Resources (DNR) has placed a wireless sensor under the water in the middle of each lake that measures the clarity every minute and reports a single number indicating water clarity. The sensors have wireless network connections and each run a Web server that reports
the result as a simple HTML page. The sensor has limited power, so you want its Web server to only be touched once per minute. Your Web service runs on a computer on the shore of each lake. It scrapes the screen of the sensor Web site, and presents the results as a Web service. We want a main DNR Web site to have a display of the clarity of water in all of the lakes in the state.

Draw an architecture of the entire system, including the
sensors and the final Web site. Explain how it works.

What are the practical and philosophical differences between
having the sensor run a Web server and a web service directly

Best answer:

Answer by melancholygiant
Technically a web server is a web service – of sorts. It responds to HTTP requests, typically with HTML documents. However, the documents do not adhere to the SOAP standards implemented by most newer web services so the only recourse is to hunt the HTML for keywords and tags that indicate where the data you’re scraping for is located.

Since you have some practical limitations on how frequently these devices could be called, my first inclination would be to develop a centralized “collection” service that periodically polled the various clarity monitoring devices and stored the data in a local database (timestamped from an accurate, central time source). It would still do the “scraping” from the various devices, but would act as a proxy to minimize the amount of traffic each device was required to handle. The polling interval would be based upon how frequently you needed to update the data.

I’m assuming these devices can be accessed via TCP/IP. Lacking any drawing tools, the architecture is fairly simple.

[Polling Server] — [Clarity Monitoring Devices]
[Database Server]
[Web Service]
[Clients] or [Web Server]

What would help is if you have the ability to modify the web page on the monitoring devices. If so you could customize the HTML response to conform to a standard SOAP document that could be called as a remote object from the polling server (instead of having to parse the HTML). Alternatively, you may also be able to have the web server on the monitoring devices respond in an XML format that can be much more easily parsed by the Polling Server. I am assuming this is possible since the web server on these devices provides clarity information on-demand (which typically requires some sort of scripting).

If you would like additional details, please e-mail me at

Add your own answer in the comments!