Can't get cxf and cxf-client to work at the same time grails

喜欢而已 提交于 2019-12-11 11:18:37

问题


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.

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 ?

Using grails version 2.3.7 Cxf version 1.1.4 cxf-client 1.6.1


回答1:


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 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.



来源:https://stackoverflow.com/questions/26470223/cant-get-cxf-and-cxf-client-to-work-at-the-same-time-grails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!