在使用cxf开发webservice时,启动Server时遇到Could not find destination factory for transport http://schemas.xmlsoap.org/soap/http错误。Server代码如下:
public static Object[] invokeRemoteMethod(String url, String method, Object[] parameters) {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
if (!url.endsWith("wsdl") && !url.endsWith("WSDL")) {
url += "?wsdl";
}
org.apache.cxf.endpoint.Client client = dcf.createClient(url);
try {
Object[] objects = client.invoke(method, parameters);
return objects;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
调用时按照顺序设置参数。
加入cxf-rt-transports-http-jetty包解决。