CXF 2.4.2:找不到命名空间http://schemas.xmlsoap.org/soap/http的管道启动器

我有一个从wsdl生成的服务客户端。 我正在尝试呼叫远程服务,我收到下面看到的导管启动器错误。 我尝试了很多解决方案但没有成功。

我找到了推荐使用http-jetty扩展的解决方案(旧post)。 我不相信这对我有意义,因为服务器没有在本地运行。

我还发现帮助我的最近配置是一个示例cxf.xml文件,其中包含:

   http://cxf.apache.org/transports/local http://cxf.apache.org/transports/http http://schemas.xmlsoap.org/soap/http http://schemas.xmlsoap.org/wsdl/soap/http    

此配置提供有关如何配置传输工厂并将其绑定到http://schemas.xmlsoap.org/soap/http的指导 。 当我尝试使用HTTPTransportFactory时 ,我收到一个exception,它无法初始化(没有这样的方法错误)。

 Caused by: org.apache.cxf.BusException: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:112) at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:73) at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:61) at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:708) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:476) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:309) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:261) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:127) 

预防措施:此时,我将停止尝试将我的CXF客户端升级到2.4.2,然后再回到最老的版本(2.2系列)。 这不太理想。

我想继续升级。 有关如何配置CXF 2.4.X的任何建议,以便我的客户端HTTP SOAP配置正确连接将非常适合。

就像旧post推荐的那样,这可以通过在混合中添加cxf-rt-transports-http-jetty来解决。

客户端上的无效url格式可能会产生此错误。 例如,如果使用http传输,则应定义“http:// localhost:8080 / services / {smth}”url。 如果你定义没有http前缀的“localhost:8080 / services / {smth}” – 你会收到这样的错误。

你把cxf-rt-binding-soap-2.4.x.jar放到你的类路径中了吗?

最近我将cxf-rt-ws-security升级到3.0.0。 从那时起,我开始获取org.apache.cxf.BusException:找不到命名空间http://schemas.xmlsoap.org/soap/http的管道启动器。 在org.apache.cxf.bus.managers.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:110)。

在我的pom.xml中将以下jar升级到3.0.0后,此问题得到了解决cxf-rt-frontend-jaxws cxf-rt-ws-policy cxf-rt-transports-http

这不适用于列出的原始海报的示例url,但是当url不正确时,我们收到此错误。 即,我们在URL路径中列出了两次而不是一次的特定字符串。

我也面临同样的问题。 通过IntelliJ一切正常,但maven surefire引发了错误。 终于找到了答案。 这里是:

基本上cxf库都提供META-INF / cxf / bus-extensions.txt文件,打包器的默认行为是替换该文件,导致它不完整。 通过配置着色器来追加而不是替换cxf东西会表现正常。

将其添加到插件部分中pom的构建部分:

   org.apache.maven.plugins maven-shade-plugin 1.4  true    package  shade     META-INF/cxf/bus-extensions.txt     *:*  META-INF/*.SF META-INF/*.DSA META-INF/*.RSA        

从我的POM中删除此依赖项为我修复了错误

   org.apache.cxf cxf-rt-frontend-jaxws 3.1.1  

我有这种错误的类似情况,因为这个问题似乎与以下jar子的旧版本一起出现

 cxf-core-2.x.jar cxf-rt-frontend-jaxrs-2.x.jar cxf-rt-rs-client-2.x.jar cxf-rt-transports-http-2.x.jar 

当我切换到这些jar子的最新版本时(3.2.1,在撰写本文时)已经解决了错误。