cxf调用报错Could not find conduit initiator for address:

依赖

<dependency>

    <groupId>org.apache.cxf</groupId> 
    <artifactId>cxf-rt-frontend-jaxws</artifactId> 
    <version>3.2.2</version> 
</dependency> 

 

测试代码    

@Test

    public void test1() { 
        JaxWsProxyFactoryBean jaxWs = new JaxWsProxyFactoryBean(); 
        jaxWs.setAddress("http://192.168.8.254:11090/artesia-ux-ws/services/ArtesiaLoginService"); 
        jaxWs.setServiceClass(ArtesiaLoginService.class); 
        ArtesiaLoginService als = (ArtesiaLoginService) jaxWs.create(); 
        LoginSession login = als.login("tsuper", "Passw0rd!"); 
        System.out.println(login.getId().getIdString()); 

    }

报错:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not find conduit initiator for address: http://192.168.8.254:11090/artesia-ux-ws/services/ArtesiaLoginService and transport: http://schemas.xmlsoap.org/soap/http

at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161) 
at com.sun.proxy.$Proxy47.login(Unknown Source) 
at com.zvn.test.hmc.WebServiceTest.main(WebServiceTest.java:16) 
Caused by: java.lang.RuntimeException: Could not find conduit initiator for address: http://192.168.8.254:11090/artesia-ux-ws/services/ArtesiaLoginService and transport: http://schemas.xmlsoap.org/soap/http 
at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:228) 
at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:233) 
at org.apache.cxf.endpoint.AbstractConduitSelector.createConduit(AbstractConduitSelector.java:146) 
at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:108) 
at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63) 
at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:870) 
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:528) 
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:442) 
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:343) 
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296) 
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) 

... 2 more

 

 

接口地址没问题:所以问题是 transport: http://schemas.xmlsoap.org/soap/http

SOAP的传输协议是基于http协议的,需要相关依赖

报错解决方案:

添加依赖:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>3.2.2</version>
</dependency>

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值