部分银行项目有用到mq队列管理器用于消息的处理下发,该项目是通过webservice进行连接,下面是具体cxf+spring配置文件:调用只需要把相关的jar包与对应的属性进行修改即可
客户端配置如下:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:jms="http://cxf.apache.org/transports/jms"
xmlns:wsa="http://cxf.apache.org/ws/addressing"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd" default-lazy-init="true" default-autowire="byName">
<!--p:targetDestination="queue://MQCCC/LOCALQ.SMS.SMSMTSOAP.REQ"
p:replyDestination="queue://MQCCC/LOCALQ.GSP.RSP"-->
<bean id="jmsSmsOutputConfig" class="org.apache.cxf.transport.jms.JMSConfiguration"
p:receiveTimeout="5000000"
p:connectionFactory-ref="jmsConnectionFactory"
p:targetDestination="queue://MQCCC/REMOTEQ.GSP.SMSMTSOAP.REQ"
p:replyDestination="queue://MQCCC/LOCALQ.GSP.RSP"
p:concurrentConsumers="1"
p:maxConcurrentConsumers="1000"
p:wrapInSingleConnectionFactory="true"
p:useJms11="true" />
<!--MQ 客户端配置连接信息-->
<bean id="jmsConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory">
<bean class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="channel" value="SYSTEM.DEF.SVRCONN"></property>
<property name="queueManager" value="MQCCC"></property>
<property name="hostName" value="182.119.171.65"></property>
<property name="port" value="1415"></property>
<property name="CCSID" value="1208"></property>
<property name="transportType" value="1"></property>
</bean>
</property>
<property name="sessionCacheSize" value="4"></property>
</bean>
<jaxws:client id="smsMtService" xmlns:o="http://sms.service.bankcomm.com/Abstraction/Atomic/business.smsmt.SmsMtSOAP"
serviceClass="com.incesoft.commbank.smsservice.output.SmsMt" serviceName="o:SmsMt" endpointName="o:SmsMtSOAP" address="jms://" >
<!--设置拦截器-->
<jaxws:inInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
</jaxws:inInterceptors>
<jaxws:outInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
</jaxws:outInterceptors>
<!--<property name="endpointAddress" value=""/>-->
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
<bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.cxf.transport.jms.JMSConfigFeature"
p:jmsConfig-ref="jmsSmsOutputConfig" />
<wsa:addressing/>
</jaxws:features>
</jaxws:client>
</beans>
服务器端配置如下:
<?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:cxf="http://cxf.apache.org/core"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:jms="http://cxf.apache.org/transports/jms"
xmlns:wsa="http://cxf.apache.org/ws/addressing"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd"
default-lazy-init="true" default-autowire="byName">
<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-extension-local.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jms.xml" />
<!-- targetDestination服务端监听的队列属性 -->
<bean id="jmsSmsSendConfig"
class="org.apache.cxf.transport.jms.JMSConfiguration"
p:receiveTimeout="50000"
p:connectionFactory-ref="jmsSmsSendConnectionFactory"
p:targetDestination="queue://MQCCC/LOCALQ.GSP.SMSSENDSERVICE.REQ"
p:concurrentConsumers="5" p:maxConcurrentConsumers="1000"
p:wrapInSingleConnectionFactory="true" p:useJms11="true" />
<!-- 服务器端连接配置方式连接 port:1208 UTF8 ,1380 GBK-->
<bean id="jmsSmsSendConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory">
<bean class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="channel" value="SYSTEM.DEF.SVRCONN"></property>
<property name="queueManager" value="MQCCC"></property>
<property name="hostName" value="182.119.171.65"></property>
<property name="port" value="1415"></property>
<property name="CCSID" value="1208"></property>
<property name="transportType" value="1"></property>
</bean>
</property>
<property name="sessionCacheSize" value="5"></property>
</bean>
<bean name="smsSend"
class="com.incesoft.commbank.smsservice.SmsSendServicePortTypeImpl">
<property name="robotInputservice">
<ref bean="robotInputservice" />
</property>
</bean>
<jaxws:endpoint id="smsSendService"
xmlns:customer="http://ccc.service.bankcomm.com/abstraction/atomic/business.SmsSendService/1_0"
implementor="#smsSend" address="jms://">
<jaxws:features>
<wsa:addressing
xmlns:wsa="http://cxf.apache.org/ws/addressing" />
<bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.cxf.transport.jms.JMSConfigFeature"
p:jmsConfig-ref="jmsSmsSendConfig" />
</jaxws:features>
</jaxws:endpoint>
</beans>
mq相关jar包过大,无法上传
分享到:
相关推荐
简单的webservice+Cxf+Spring数据对接实例以及jar.rar简单的webservice+Cxf+Spring数据对接实例以及jar.rar简单的webservice+Cxf+Spring数据对接实例以及jar.rar简单的webservice+Cxf+Spring数据对接实例以及jar.rar...
cxf+spring实现webservice
CXF+spring+struts实现WebService
cxf+spring+client+springmvc
cxf+spring+tomcat 只是演示,一个helloWorld的例子
内容为CXF整合spring的服务端和客户端开发例子,注释不太详尽,网上的教程比较多,但是多跑不起来,特地把整个工程都打包给大家做参考,程序内容均来自网上整理,均可以运行。
cxf+spring整合,只要把项目导入到myeclipse中,就可以运行。
CXF+Spring+Tomcat发布WebService
代码是我一行行敲的,直接部署就能用,service,client端实现了:(cxf用的是3.0最新的) 1维数组, 2维数组, 3维数组, List, List , Map(adapter方式实现的), 直接返回bean, 返回object[], 做了header的安全认证校验.
这是我在使用cxf+spring进行开发中的一点总结,如何搭建开发环境、如何配置dao使用,如何解决乱码问题等的经验分享
cxf+spring开发所必备的jar包压缩包
基于maven的cxf+spring简单demo,spring版本为4.1.6,cxf版本为3.0.8
web项目使用spring和cxf的一个开发实例,有简单的代码样例和jar。是一个完整的项目,最终发布完成时访问 http://ip:port/项目名称/webservices/ 就会发现你发布的webservice服务。
CXF+Spring+MyBatis+Maven项目整合,包含服务端和客户端。
这个是cxf 集成spring 的webservice的例子 供大家参考
cxf+spring开发webservice的简单实例,通过查看cfx的doc文档确定wsdl支持所引用的最少jar包
使用cxf+spring框架开发webservice的客户端与服务端代码,用于连接两个项目
利用CXF和Spring结合搭建的SOA例子,内容包含服务端配置和一个客户端测试配置,服务器端服务配置在beans.xml中,web.xml文件需要修改;客户端测试配置地址是demo.spring.client下的client-beans.xml,测试类为...
基于CXF的WebService服务端和客户端示例,CXF+Spring,希望能为WebService开发者提供帮助。WebService,CXF,Spring.
cxf+spring+hibernate集成整合jar包