当前位置:网站首页>CXF call reports an error. Could not find conduct initiator for address:

CXF call reports an error. Could not find conduct initiator for address:

2022-07-07 23:13:00 Scale biubiu

rely on

<dependency>

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

 

Test code     

@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()); 

    }

Report errors :

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

 

 

No problem with the interface address : So the question is transport: http://schemas.xmlsoap.org/soap/http

SOAP The transmission protocol of is based on http Agreed , Dependency required

Error reporting solutions :

Add dependency :

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

原网站

版权声明
本文为[Scale biubiu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130600283250.html