我有一个从wsdl生成的服务客户端。我尝试调用远程服务,但是收到了下面看到的conduit initiator错误。我尝试了很多解决方案都没有成功。
我找到了一些(旧的帖子)解决方案,建议使用http-jetty扩展。我不认为这对我有意义,因为服务器不在本地运行。
我还发现最接近帮助我的配置是一个包含以下内容的示例cxf.xml文件:
<bean class="org.apache.cxf.transport.local.LocalTransportFactory"
lazy-init="false">
<property name="transportIds">
<list>
<value>http://cxf.apache.org/transports/local</value>
<value>http://cxf.apache.org/transports/http</value>
<value>http://schemas.xmlsoap.org/soap/http</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
</list>
</property>
</bean>
此配置提供如何配置传输工厂并将其绑定到http://schemas.xmlsoap.org/soap/http的指导。当我尝试使用HTTPTransportFactory时,会收到初始化失败的异常(无此方法错误)。
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配置正确连接有任何建议,将不胜感激。