MyEclipse10开发XFIRE

Xfire插件的安装参考MyEclipse10离线安装xfire插件

1.创建一个web应用,名为xfiredemo

1

 

2.将META-INF目录剪切到WEB-INF目录下

2

3.在META-INF目录下 创建文件 services.xml

内容如下:

 

<?xml version="1.0" encoding="UTF-8"?>
<beans>
	<service xmlns="http://xfire.codehaus.org/config/1.0">
		<name>dmDataShowTest</name>
		<serviceClass>
			com.stalvan.IDemo
		</serviceClass>
		<implementationClass>
			com.stalvan.IDemoImpl
		</implementationClass>





<style>wrapped</style>





		<use>literal</use>
		<scope>application</scope>
	</service>
</beans>

4.修改本工程的web.xml文件

内容如下

 

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

5.在项目上右键点击MyEclipse->add spring capabilities。勾选core和web并复制jar到本工程中。

2

6.创建包com.stalvan 在包com.stalvan下创建接口IDemo

 

package com.stalvan;

public interface IDemo {
	public String hello(String name);
}

7.在包com.stalvan下创建实现类IDemoImpl

 

package com.stalvan;

public class IDemoImpl implements IDemo {

	@Override
	public String hello(String name) {
		System.out.println("invoked " + name);
		return "hello" + name;
	}

}

8.复制xbean-spring-2.8.jar到lib目录下,并加入buildPath.(下载地址xbean-spring-2.8.jar)

9.部署到tomcat上,我用的是tomcat7。访问http://localhost:8080/xfiredemo/services/dmDataShowTest?wsdl

开发完成