XFire的簡單配置
有段時間業務需要webservice,所以弄了下XFire,發現這個工具真的很傻瓜,接下來我就把如何配置詳細的說一下。首先要引入相關的jar包,jar包我就不再這里列表了,童鞋們自己去下吧,呵呵,我用的版本是1.2.6,所以我只能保證在1.2.6下運行是正常的。
其次,請打開你的web.xml在里面添加一個servlet并將xfile的配置說明加入進去






1
<servlet>
2
<servlet-name>xfire</servlet-name>
3
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
4
</servlet>
5
6
<servlet-mapping>
7
<servlet-name>xfire</servlet-name>
8
<url-pattern>/ws/*</url-pattern>
9
</servlet-mapping>
請在WEB-INF下添加一個xfire-servlet.xml文件,具體內容如下
2

3

4

5

6

7

8

9































1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core"
4
xsi:schemaLocation="http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
5
default-lazy-init="true">
6
7
<description>Apache CXF的Web Service配置</description>
8
<!-- WebService的實現Bean定義 -->
9
<bean id="netSuiteService" class="com.akazam.ws.impl.NetSuiteServiceImpl"/>
10
</beans>

2

3

4

5

6

7

8

9

10

接下來你只需要實現相關的接口就可以了

posted on 2011-04-06 11:13 Cloud kensin 閱讀(427) 評論(0) 編輯 收藏 所屬分類: 其他