public class WsClientUtil {
public static Object[] invokeWs(String url,String method,Object[] params) {
JaxWsDynamicClientFactory dcfClient = JaxWsDynamicClientFactory.newInstance();
Client client = dcfClient.createClient(url);
Object[] response'
try {
response = client.invoke(method,params);
} catch(Exception e) {
//错误处理
}
return response;
}
}
maven项目依赖:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>version</version>
</dependency>