java soapbinding,带有Spring MVC的Apache CXF客户端-BindingInfo不是SOAPBindingInfo

I am working on a spring MVC project, from which I need to access a webservice(client mode)

My web service client is a different maven project which is working fine from its JUnit test cases.

When i add this as a dependency to my Spring MVC project and access the jar file, I am getting the following exception.

Jul 10, 2012 2:40:09 PM org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: Servlet.service() for servlet [rest] in context with path [/mdot] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: Can not initialize SoapBinding, BindingInfo is not SoapBindingInfo] with root cause

java.lang.RuntimeException: Can not initialize SoapBinding, BindingInfo is not SoapBindingInfo

at org.apache.cxf.binding.soap.SoapBindingFactory.createBinding(SoapBindingFactory.java:385)

at org.apache.cxf.endpoint.EndpointImpl.createBinding(EndpointImpl.java:135)

at org.apache.cxf.endpoint.EndpointImpl.(EndpointImpl.java:82)

at org.apache.cxf.jaxws.support.JaxWsEndpointImpl.(JaxWsEndpointImpl.java:125)

at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.createEndpoint(JaxWsServiceFactoryBean.java:235)

at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createEndpoints(ReflectionServiceFactoryBean.java:328)

at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:260)

at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)

at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)

at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)

at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:153)

at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:151)

at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:464)

at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:331)

at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:318)

at javax.xml.ws.Service.getPort(Service.java:119)

at com.test.wsdl.MyWebServiceSOAP_Service.getMyWebServiceSOAPPort(MyWebServiceSOAP_Service.java:63)

I just found that my mvc project has a cxf bus running in it already.

I could not find any additional configuration but i think some REST service interceptors are taking part in my SOAP service client or some other conflict like this. Any Idea ?

解决方案

I changed my code from programmatically creating web service to use spring like:

serviceClass="demo.spring.HelloWorld"

address="http://localhost:9002/HelloWorld" />

and it started working in integrated project also. However I did not understand the reason yet. It would be helpful if anybody can show me the reason.

Thanks.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值