摘要
电子商务的蓬勃发展使得越来越多的采购商们倾向于利用互联网络进行采购。然而,尽管大部分商业网站都提供了详细周全的产品查询功能,但是当采购商们需要查询大量产品,譬如电子产品元器件,来进行采购时,往往费时费力。而网页这种适宜人类用户进行查询浏览的界面形式并不适合程序来自动处理,一个原因就是网页结构的变化会影响网页数据的抽取过程。本文利用网络服务的思想,使数据抽取通过网站提供的独立于网页的服务来完成,从而避免网页结构变化的影响。在剖析了表述性状态转移面向资源以及对资源进行操作的统一接口特性后,本文指出表述性状态转移用于网络服务的优势。基于这种思想,利用CXF框架和Spring技术构建一个表述性状态转移风格的服务平台,该平台向客户提供查询电子产品信息的网络服务。在此服务支持下,客户端程序可以利用XML解析工具方便地抽取所需要的数据信息。
The development of E-commerce encourages more and more buyers to purchase products via the Internet. Although most of business websites provide comprehensive query functions to help buyers find out what they want, unfortunately, when it comes to huge quantities of queries of different products, this kind of human query in front of a screen becomes time-consuming and tedious. And it is not easy for programs to extract Web data from Web pages. One reason is that the structure of Web pages may change. This paper uses the thinking of Web service to solve this problem. Web data extraction is done through a kind of Web service, independent of Web pages, provided by the website. This paper analyzes the way of thinking behind REST ( Representa- tional State Transfer) and illuminates the central abstraction concept of resource and the feature of emphasizing the uniform interface, which distinguishes REST architecture style from other network-based architecture styles. It points that RESTful Web serv- ice is a better solution to build Web services, compared with SOAP-style Web service. Constructing a RESTful Web service which provides electronic product query service based on Apache CXF framework in the context of Spring technology, and based on this service, a data extraction client can obtain Web data conveniently using XML parser tools.
出处
《计算机与现代化》
2012年第1期122-125,共4页
Computer and Modernization