无法同时使cxf和cxf-client工作 [英] Can't get cxf and cxf-client to work at the same time grails

查看:102
本文介绍了无法同时使cxf和cxf-client工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我同时使用cxf和cxf-client时遇到问题. cxf表示找不到任何服务. 当我评论cxf-client的配置时,cxf会找到服务.

I have a problem when I use both cxf and cxf-client together. The cxf says that it can't find any services. When I comment the configuration for the cxf-client the cxf finds the services.

servlet的配置是标准配置. 由EU TIN服务进行的客户端配置.

The configuration for the servlet is the standard configuration. The configuration for the client made from EU TIN service.

这两个插件可以分开找到,但不能一起找到. 有没有人找到这个问题的解决方案?

The two plugins works find seperately but not together. Have anyone find a solution for this problem ?

使用grails版本2.3.7 Cxf版本1.1.4 cxf-client 1.6.1

Using grails version 2.3.7 Cxf version 1.1.4 cxf-client 1.6.1

推荐答案

我设法通过稍微修改CXF客户端插件来解决相同的问题.在WebServiceClientFactoryImpl中,修改创建JaxWSProxyFactoryBean的步骤如下:

I managed to get around the same problem by modifying CXF client plugin a bit. In WebServiceClientFactoryImpl modify creating JaxWSProxyFactoryBean as follows:

Bus bus = Holders.grailsApplication.mainContext.getBean("cxf") as Bus
JaxWsProxyFactoryBean clientProxyFactory = new JaxWsProxyFactoryBean(serviceClass: serviceInterface,
            address: serviceEndpointAddress, bus: bus)

CXF插件创建类型为org.apache.cxf.bus.spring.SpringBus的'cxf'bean. CXF客户端(默认情况下)会创建另一条似乎中断CXF Web服务的总线.通过在CXF客户端中使用相同的总线,问题得以解决.

CXF plugin creates that 'cxf' bean which is of type org.apache.cxf.bus.spring.SpringBus. CXF client creates (by default) another bus which seems to break CXF web service. By using the same bus in CXF client the problem was solved.

这篇关于无法同时使cxf和cxf-client工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆