摘 要:Web服務是一個嶄新的分布式計算模型,它的研究重點是Web服務的新型構架,Web服務的高效執行方式,Web服務與其他成熟技術的有機結合以及Web服務的集成是解決現實應用問題的重要技術。為了充分發揮 Web 服務的靈活性,用戶必須能夠動態地發現和調用 Web 服務。動態發現Web服務的研究目標是服務發現的高效率和自動化。在此使用Java的開放源碼包uddi4j,wsdl4j和Apache Axis 2來實現Web服務的動態發現與調用的方法。該方法實現了Web服務與Java技術的有機結合,為更高效率的應用Web服務提供一種思路。
關鍵詞:分布式計算模型; Web服務;Java; UDDI
中圖分類號:TN911; TP273 文獻標識碼:A
文章編號:1004-373X(2010)14-0086-03
Dynamic Discovery and Invocation of Web Service Based on Java Technology
SU Jin-zhi,LI Zhi-wu
(Vocational and Technological College, Liaoning Shihua University, Fushun 113001, China)
Abstract:Web service is a new distributed computing model, and it is also an effective mechanism for the data and service integration on the web. Thus, web service has become a solution to E-business. It is important and necessary to carry out the research on the new architecture of web service in combination with other good techniques and on the integration of services. The Web services must be dynamically discovered and invoked in order to give full play to its flexibility, whose research aim is high efficient and automation. According to the Web Service model framework, the method of dynamic discovery and invocation of Web service using the open source packages uddi4j, wsdl4j, and Apache Axis based on Java technologies is introduced. The method, which puts Web service together with Java technologies can effectively make use of Web Service.
Keywords:distributed computing model; Web service; Java; UDDI
0 引 言
Web服務(Web Service)是一種用于應用程序集成的新技術,它并不追求代碼的可移植性,而是要使分布在互聯網中的各種系統實現交互[1]。它是下一代互聯網分布式計算的基本組成單元。Web Service提供者通過Web服務描述語言(web services description language,WSDL)的規范發布Web服務。服務請求者利用UDDI(universal description discovery and integration)協議在服務注冊中心發布注冊,在服務代理中查找所需的服務,根據返回信息的Web服務WSDL描述文件找到服務提供地址,按照服務提供者要求的規范與之綁定,采用SOAP通信使用服務提供者的服務。
Web Service的體系構架是基于服務提供者、服務注冊中心和服務請求者3個角色和發現、發布、綁定3個動作組成的[2]。發布是為了讓用戶或其他服務知道某個Web Service的存在以及相關信息,發現是為了找到合適的Web Service,綁定則是在提供者和使用者之間建立某種聯系。
1 Web服務的動態發現與調用
對于Web Service而言,其典型的體系構架應當如圖1所示[3]。……