Question: 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 \nthe 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. \n\nDraw an architecture of the entire system, including the \nsensors and the final Web site. Explain how it works. \n\nWhat are the practical and philosophical differences between \nhaving the sensor run a Web server and a web service directly

Answer: 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.\n\nSince 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.\n\nI'm assuming these devices can be accessed via TCP/IP.  Lacking any drawing tools, the architecture is fairly simple.  \n\n[Polling Server] -- [Clarity Monitoring Devices]\n    |\n    |\n[Database Server]\n    |\n    |\n[Web Service]\n    |\n    |\n[Clients] or [Web Server]\n\nWhat 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).\n\nIf you would like additional details, please e-mail me at melancholygiant@yahoo.com.
This question from the Yahoo Q&A forum is categorized in the topic: Science & Mathematics