CXF服务端客户端配置详解
2014-11-05 17:01
316 查看
服务端:
<!-- CXF 配置 -->
< servlet >
< servlet-name > CXFServlet </ servlet-name >
< servlet-class > org.apache.cxf.transport.servlet.CXFServlet </ servlet-class >
< load-on-startup > 1 </ load-on-startup >
</ servlet >
< servlet-mapping >
< servlet-name > CXFServlet </ servlet-name >
< url-pattern > /services/* </ url-pattern >
</ servlet-mapping >
在spring配置文件里
<!-- WebService部分 -->
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean id="pwimpl" class="com.huisou.point.webservice.impl.PointWsImpl" />
<jaxws:endpoint id="pointWs" implementor="#pwimpl"
address="/pmw" />
接口的实现类
a7d7
:
@WebService(endpointInterface="com.huisou.point.webservice.PointWs")
public class PointWsImpl implements PointWs {
@Resource
private PointMng pm;
public int dealPoint(Integer companyId, Integer userId, Integer pointType) {
return pm.dealPoint(companyId, userId, pointType);
}
public int getPoint(Integer userId) {
return pm.getPoint(userId);
}
}
注意:都要在顶部加上@webservice通配符
====================================================================================
客户端:
<bean id="pw" class="cms.huisou.info.manage.PointMng" factory-bean="clientFactory" factory-method="create" />
<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="cms.huisou.info.manage.PointMng" />
<property name="address" value="http://e.huisou.com/ws/pmw" />
</bean>
<!-- CXF 配置 -->
< servlet >
< servlet-name > CXFServlet </ servlet-name >
< servlet-class > org.apache.cxf.transport.servlet.CXFServlet </ servlet-class >
< load-on-startup > 1 </ load-on-startup >
</ servlet >
< servlet-mapping >
< servlet-name > CXFServlet </ servlet-name >
< url-pattern > /services/* </ url-pattern >
</ servlet-mapping >
在spring配置文件里
<!-- WebService部分 -->
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean id="pwimpl" class="com.huisou.point.webservice.impl.PointWsImpl" />
<jaxws:endpoint id="pointWs" implementor="#pwimpl"
address="/pmw" />
接口的实现类
a7d7
:
@WebService(endpointInterface="com.huisou.point.webservice.PointWs")
public class PointWsImpl implements PointWs {
@Resource
private PointMng pm;
public int dealPoint(Integer companyId, Integer userId, Integer pointType) {
return pm.dealPoint(companyId, userId, pointType);
}
public int getPoint(Integer userId) {
return pm.getPoint(userId);
}
}
注意:都要在顶部加上@webservice通配符
====================================================================================
客户端:
<bean id="pw" class="cms.huisou.info.manage.PointMng" factory-bean="clientFactory" factory-method="create" />
<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="cms.huisou.info.manage.PointMng" />
<property name="address" value="http://e.huisou.com/ws/pmw" />
</bean>
相关文章推荐
- CXF密码验证_服务端和客户端配置
- nagios 服务端与客户端监控安装与详细配置,各配置文件详解
- CXF之用spring配置服务端和客户端实例
- centos 6.5环境利用iscsi搭建SAN网络存储服务及服务端target和客户端initiator配置详解
- WEBSERVICE之CXF服务端与客户端配置(初级应用,本人才疏学浅啊)
- centos 6.5环境利用iscsi搭建SAN网络存储服务及服务端target和客户端initiator配置详解
- CXF之用spring配置服务端和客户端实例(转)
- CXF之用spring配置服务端实例(1)
- CXF中服务端与客户端通信的Model类不能使用泛型
- oracle 11g即时客户端配置详解
- SVN 1.6 服务端和客户端安装配置
- CSLA.Net 学习 - WCF服务端与客户端配置
- Eclipse+SVN--SVN版本控制服务端和客户端配置(Apache+SVN+TortoiseSVN+Eclipse+Subclipse plugin)
- Siebel客户端安装配置详解
- IBM WebSphere MQ 在AIX环境服务端和模拟客户端配置步骤
- Win2003证书服务配置/客户端(服务端)证书申请/IIS站点SSL设置
- CXF之用spring配置客户端实例(1)
- CXF之用spring配置服务端实例(2)
- Win2003证书服务配置/客户端(服务端)证书申请