JDK1.7 + Tomcat7 + Eclipse + XFire development WebService

XFire is a new generation of Java Web services engine, XFire makes publishing Web services in JavaEE applications a breeze. Compared with other Web services engine, XFire configuration is very simple, and very easy to Spring integration, it enables Java developers can finally get .Net developers and the same development efficiency. Official Website: http: //xfire.codehaus.org/

1.XfFireDemo directory structure

 

 Involved jar:

/XFireDemo/WebContent/WEB-INF/lib/commons-codec-1.2.jar
/XFireDemo/WebContent/WEB-INF/lib/commons-httpclient-3.1.jar
/XFireDemo/WebContent/WEB-INF/lib/commons-logging-1.0.4.jar
/XFireDemo/WebContent/WEB-INF/lib/jdom-1.0.jar
/XFireDemo/WebContent/WEB-INF/lib/spring-1.2.6.jar
/XFireDemo/WebContent/WEB-INF/lib/stax-api-1.0.1.jar
/XFireDemo/WebContent/WEB-INF/lib/wsdl4j-1.6.1.jar
/XFireDemo/WebContent/WEB-INF/lib/xbean-spring-2.8.jar
/XFireDemo/WebContent/WEB-INF/lib/xfire-all-1.2.6.jar
/XFireDemo/WebContent/WEB-INF/lib/XmlSchema-1.4.6.jar
/XFireDemo/WebContent/WEB-INF/lib/xstream-1.3.1.jar

2.services.xml

<? xml Version = "1.0" encoding = "UTF-8"?>
<Beans>
 <Service xmlns = "http://xfire.codehaus.org/config/1.0">
  <-! service name, client calls when you need this ->
  <name> XFireDemo </ name>
  <-! URL is generally of little value ->
  <namespace> http://www.hello.com </ namespace>
  <-! interface class ->
  <serviceClass> service.IHelloWorld </ serviceClass>
  <-! implementation class ->
  <ImplementationClass> service.HelloWorld </ ImplementationClass>
 </-Service>
</ Beans>

 

3. Modify WebContent \ WEB-INF \ web.xml contents of the configuration file, the following is the modified web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>XFireDemo</display-name>
   <servlet>
    <servlet-name>XFireServlet</servlet-name>
    <servlet-class>  
        org.codehaus.xfire.transport.http.XFireConfigurableServlet  
    </servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>XFireServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
</web-app>

 

 

4. Enter your browser to http: // localhost: 8080 / XFireDemo / services will get the correct web service has been successfully deployed

 

 

 

 

5. Include Baidu cloud Demo Source: https: //pan.baidu.com/s/1P_WUlxR4InnehSNquR04BA extraction code: 63dj

 

Guess you like

Origin www.cnblogs.com/cpbm/p/11616687.html