CN103631595A - Method for developing Web Service based on CXF (CeltiXfire) - Google Patents

Method for developing Web Service based on CXF (CeltiXfire) Download PDF

Info

Publication number
CN103631595A
CN103631595A CN201310648938.XA CN201310648938A CN103631595A CN 103631595 A CN103631595 A CN 103631595A CN 201310648938 A CN201310648938 A CN 201310648938A CN 103631595 A CN103631595 A CN 103631595A
Authority
CN
China
Prior art keywords
web service
cxf
wsdl
client
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310648938.XA
Other languages
Chinese (zh)
Inventor
汪祖民
王阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dalian University
Original Assignee
Dalian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dalian University filed Critical Dalian University
Priority to CN201310648938.XA priority Critical patent/CN103631595A/en
Publication of CN103631595A publication Critical patent/CN103631595A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a method for developing Web Service based on CXF (CeltiXfire). The method comprises the following steps: developing a suitable Java file according to a CXF programming requirement; generating a required WSDL (Web Services Description Language) document by the CXF, and exporting the WSDL document to form a Web Service file; examining the WSDL document corresponding to the generated Web Service file to remotely call the Web Service by a client. According to the method, a code priority development mode is used, the aim of calling the Web Service remotely by the client is fulfilled by examining the WSDL document corresponding to the generated Web Service, the problem about the universal adaptability to the development of the Web Service is solved, the process of developing the Web Server by a developer is greatly simplified, and the development speed is improved.

Description

Method based on CXF exploitation Web Service
Technical field
The present invention relates to relate to JAVA technology and Web Service communication technical field, relate in particular to a kind of method based on CXF exploitation Web Service.
Background technology
Along with fast development and the widespread use of computing machine and network technology, the level of informatization of Government and enterprise all departments has obtained significantly improving, and the quantity of the collection of data, storage, processing and propagation also grows with each passing day.Data sharing is significant to the mankind's work, and sharing of data, can make more people can use more fully existing data resource, reduces work and the corresponding expenses such as Data Collection that repeat.But form that data exist is different and in the process of data sharing, different data may be present in different platforms, visit by different modes, and these have all caused the difficulty to data sharing; In addition, due to various, be organized in while setting up own application system and storage data, lack unified planning and management, often adopt the different technology that realizes and memory technology, so data often become " information island ", be difficult to realize the fully shared of data.
Web Service is mainly in order to make the information between original each isolated website can intercom mutually, share.What Web Service was used is upper unified, the open standard of Internet (the Internet), as HTTP (Hyper Text Transfer Protocol, HTML (Hypertext Markup Language)), XML (Extensible Markup Language, extend markup language), SOAP (Simple Object Access Protocol, Simple Object Access Protocol), WSDL (Web Services Description Language, Web Service descriptive language) etc., for example, so Web service can be used in the environment (: Windows, Linux) of any these standards of support.The appearance of Web Service has met the desired basic function of dynamic business cooperation and principle, thereby makes Web not only become the platform of information sharing, and becomes the shared platform of service.But, no matter be SOAP or WSDL, all relatively copy, if wishing oneself manually to write WSDL, developer develops Web Service, difficulty is sizable.Apache CXF is a Service framework of increasing income, and can be used for simplifying user's Service exploitation, and the application based on CXF exploitation can provide the services such as SOAP, XML/HTTP, RESTful HTTP or CORBA.CXF bottom also can be used different host-host protocols, comprises HTTP, JMS or JBI etc.Meanwhile, CXF disposes flexibly, supports multiple programming language.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of method based on CXF exploitation Web Service, described method can solve the general adaptability problem of client call WebService, greatly alleviate the process that developer develops Web Service, improved tempo of development.
For solving the problems of the technologies described above, the technical solution used in the present invention is: a kind of method based on CXF exploitation Web Service, is characterized in that comprising the following steps:
1) by CXF programming requirement, develop applicable Java file;
2) CXF generates needed WSDL document, and is exported to Web Service file;
3) by checking the WSDL document corresponding to Web Service file of generation, realize this Web Service of client far call.
Preferably, described method specifically comprises the following steps: 1) for Web Service service provides class definition an interface;
2) for this interface provides the corresponding class that realizes;
3) simple DTO, User class definition;
4) definition server category;
5) at client issue Web Service, after Web Service issues successfully, use browser to visit the corresponding WSDL of Web Service, by checking this WSDL, client can this Web Service of far call.
The beneficial effect that adopts technique scheme to produce is: described method can alleviate the process that developer develops Web Service greatly, the present invention uses the preferential development mode of code, namely we only need by CXF requirement, develop applicable Java file, CXF will generate required WSDL document automatically, and exported to Web Service, by checking the WSDL document corresponding to Web Service of generation, realize the object of this Web Service of client far call, solve the general adaptability problem of exploitation Web Service, improved tempo of development.
Embodiment
A method based on CXF exploitation Web Service, is characterized in that comprising the following steps: by CXF programming requirement, develop applicable Java file; CXF generates needed WSDL document, and is exported to Web Service file; By checking the WSDL document corresponding to Web Service file of generation, realize this Web Service of client far call.
Embodiment is as follows: step 1, for Web Service service provides class definition an interface:
Figure BDA0000428719320000031
Step 2: for this interface provides the corresponding class that realizes:
Figure BDA0000428719320000032
Figure BDA0000428719320000041
Step 3: simple DTO, User class definition:
Figure BDA0000428719320000051
Figure BDA0000428719320000061
Step 4: server category of the present invention:
Figure BDA0000428719320000072
Step 5: client code example of the present invention:
Figure BDA0000428719320000073
Figure BDA0000428719320000081
After Web Service issues successfully, we use browser to visit the corresponding WSDL of Web Service of the present invention, and by checking this WSDL, client can this Web Service of far call.
Described method can alleviate the process that developer develops Web Service greatly, the present invention uses the preferential development mode of code, namely we only need by CXF requirement, develop applicable Java file, CXF will generate required WSDL document automatically, and exported to Web Service, by checking the WSDL document corresponding to Web Service of generation, realize the object of this Web Service of client far call, the general adaptability problem that solves exploitation Web Service, has improved tempo of development.
Applied specific case herein principle of the present invention and embodiment thereof are set forth, the explanation of above embodiment is just with helping understand method of the present invention and core concept thereof.It should be pointed out that for the person of ordinary skill of the art, can also carry out some improvement and modification to the present invention under the premise without departing from the principles of the invention, these improvement and modification also fall in the protection domain of the claims in the present invention.

Claims (2)

1. based on CXF, develop a method of Web Service, it is characterized in that comprising the following steps:
1) by CXF programming requirement, develop applicable Java file;
2) CXF generates needed WSDL document, and is exported to Web Service file;
3) by checking the WSDL document corresponding to Web Service file of generation, realize this Web Service of client far call.
2. the method based on CXF exploitation Web Service according to claim 1, is characterized in that specifically comprising the following steps:
1) for Web Service service provides class definition an interface;
2) for this interface provides the corresponding class that realizes;
3) simple DTO, User class definition;
4) definition server category;
5) at client issue Web Service, after Web Service issues successfully, use browser to visit the corresponding WSDL of Web Service, by checking this WSDL, client can this Web Service of far call.
CN201310648938.XA 2013-12-03 2013-12-03 Method for developing Web Service based on CXF (CeltiXfire) Pending CN103631595A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310648938.XA CN103631595A (en) 2013-12-03 2013-12-03 Method for developing Web Service based on CXF (CeltiXfire)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310648938.XA CN103631595A (en) 2013-12-03 2013-12-03 Method for developing Web Service based on CXF (CeltiXfire)

Publications (1)

Publication Number Publication Date
CN103631595A true CN103631595A (en) 2014-03-12

Family

ID=50212693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310648938.XA Pending CN103631595A (en) 2013-12-03 2013-12-03 Method for developing Web Service based on CXF (CeltiXfire)

Country Status (1)

Country Link
CN (1) CN103631595A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704280A (en) * 2019-10-10 2020-01-17 南方电网数字电网研究院有限公司 Main data monitoring system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
FANGER: "使用CXF做webservice简单例子", 《HTTP://BLOG.SINA.COM.CN/S/BLOG_9D23DF3701019NOH.HTML》 *
刺猬的温驯: "使用Apache cxf和Spring在Tomcat下发布Webservice指南", 《HTTP://WWW.CNBLOGS.COM/CHENYING99/ARCHIVE/2012/11/21/2781070.HTML》 *
李凤云等: "基于WebService的SOA实现技术研究", 《科技视界》 *
汪祖民等: "基于Web的PDM系统研究", 《机械管理开发》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704280A (en) * 2019-10-10 2020-01-17 南方电网数字电网研究院有限公司 Main data monitoring system

Similar Documents

Publication Publication Date Title
KR101145005B1 (en) Secure inter-module communication mechanism
CN103701909B (en) The rapid generation and system of Video Applications
Blackstock et al. WoTKit: a lightweight toolkit for the web of things
US20150135197A1 (en) Accessing business object resources for a machine-to-machine communication environment
US20080263216A1 (en) Remote portlet consumer with enhanced resource url processing
CN101968745A (en) Development system and development method for application programs of mobile terminal
US20150120729A1 (en) Web-based representational state transfer api server
US20190286672A1 (en) Portal connected to a social backend
CN103716319B (en) A kind of apparatus and method of web access optimization
CN112507005A (en) Method and device for processing message
Perez de Almeida et al. Thing broker: a twitter for things
CN106487856A (en) A kind of method and system of network file storage
CN105989010B (en) Web page data generation method, Web server and Web application system
CN106294760A (en) Sheet disposal method and server, client
Pastore Website development and web standards in the ubiquitous world: Where are we going
US20150067089A1 (en) Metadata driven declarative client-side session management and differential server side data submission
CN109145209B (en) Method, apparatus and storage medium for searching blockchain data
CN103631595A (en) Method for developing Web Service based on CXF (CeltiXfire)
CN102664959B (en) The wireless middleware of a kind of mobile platform
US20190188063A1 (en) Mapping computer programs to network protocol methods
US9940311B2 (en) Optimized read/write access to a document object model
CN110134391A (en) A kind of adaptation method and device for the mobile page
Martin et al. Goate: XLink and beyond
Singh et al. Enhancing Interaction between Smartphones and Web services on Cloud for improved Bandwidth and latency
BR102016011501A2 (en) DIRECT COMMUNICATION METHOD BETWEEN WEB PAGE AND A LOCAL APPLICATION

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140312