我自己发布了一个CXF的WebService服务
地址为:http://localhost:8081/ServiceTest/services/PersonService.ws?wsdl
里面函数很简单,就是参数为String,返回另外一个String
通过SOAP UI工具访问也正常
但是我通过CXF命令生成Java客户端代码
并通过JAVA调用,一直出错:
信息: Creating Service {http://wisdom.sh.cn/}PersonServiceImplService from WSDL: http://localhost:8081/ServiceTest/services/PersonService.ws?wsdl
javax.xml.ws.soap.SOAPFaultException: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:141)
at $Proxy39.getPersonName(Unknown Source)
at com.mule.nick.test.MySoapClient.call_ss(MySoapClient.java:43)
at com.mule.nick.test.MySoapClient.main(MySoapClient.java:32)
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:688)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:468)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:301)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:253)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:121)
... 3 more
No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.
请教大家,这个是为什么?
我的调用代码:URL url = new URL("http://localhost:8081/ServiceTest/services/PersonService.ws?wsdl");
//这里调用带url参数的构造函数
PersonServiceImplService impl = new PersonServiceImplService(url);
PersonServiceImpl p = impl.getPersonServiceImplPort();
//调用服务端函数------这里出错
String ss = p.getPersonName("fdasfsd");