In the previous essay, I spoke about my web site architecture, which made it necessary to use WebService in my site. For example, when users register, the user data is mainly stored in the content server, but also to submit some data to the index server, at this time, you can let the content server access to the index server to provide the webservice to submit data, but also to allow the content server to pass the timer task, Access the Index server's webservice to submit statistics.
My Site uses Springside 2.0 to develop, in Springside 2.0, the default is Xfire to provide WebService, but I follow the document, but the result failed. So I asked Jiangnan white, white recommended me to use the latest version of CXF, so I went to the official web site to download the latest version of CXF, follow the example came again, and soon succeeded. This shows that the use of CXF is not only simple, but also high success rate. Therefore, I am here to share my experience with you.
The first step, download the latest version of the CXF, download the address as shown below:
In the second step, copy the following jar files from the Lib folder in Cxf to our project's Webapp/web-inf/lib directory:
commons-logging-1.1.jar
geronimo-activation_1.1_spec-1.0-M1.jar (or Sun's Activation jar)
geronimo-annotation_1.0_spec-1.1.jar (JSR 250)
geronimo-javamail_1.4_spec-1.0-M1.jar (or Sun's JavaMail jar)
geronimo-servlet_2.5_spec-1.1-M1.jar (or Sun's Servlet jar)
geronimo-ws-metadata_2.0_spec-1.1.1.jar (JSR 181)
jaxb-api-2.0.jar
jaxb-impl-2.0.5.jar
jaxws-api-2.0.jar
neethi-2.0.jar
saaj-api-1.3.jar
saaj-impl-1.3.jar
stax-api-1.0.1.jar
wsdl4j-1.6.1.jar
wstx-asl-3.2.1.jar
XmlSchema-1.2.jar
xml-resolver-1.2.jar
cxf-2.0-incubator.jar
There are some packages in my project that are already with me, except that the version provided in the CXF will be updated. After you copy the packages into your project, you can delete the lower versions of the project and delete all the Xfire-related packages. Of course, do not delete also can, because I tried, even if there are several different versions of the package, there will be no conflict.
Of course, the light copies of these packages to the project do not guarantee a smooth development, and you need to set up a library of projects in Eclipse, as shown below: