1、 导入XFire包
2、 建一个名为XXX.webservice.XXX的包
3、 选中包右键new – other… - MyEclipse – Web Services – WebService
4、 点next,选择项目。Framework选择XFire。Strategy选择…from Java bean…选中Create new Java bean
5、 点击next。Web service name与数据库中的表相对应。选择Java package 结束
6、 找到webservice文件夹下的services.xml将<service>节点注释掉
7、 在applicationContext-service中配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- bean中的class为实现接口的类;property的name为类中引用的属性名称;ref为spring注册的名称,如上面的client-->
<importresource="classpath:org/codehaus/xfire/spring/xfire.xml" />
<bean name="nztPeasant" class="org.codehaus.xfire.spring.ServiceBean">
<property name="serviceBean" ref="serviceName" />
<property name="serviceClass" value="类路径" />
</bean>
<bean id="serviceName" class="bean路径"><property name="service" ref="service" />
这里写的是对应的类中定义的属性
</bean>
</beans>
8、 运行myeclipse访问路径…/service
9、 Delphi中file – new – other…
10、 选择webservices – WSDLImporter 打开,复制路径下一步