1.首先使用CXF的客户端,需要引入相应的依赖包
<properties>
<cxf.version>2.7.18</cxf.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
</dependencies>
2.添加完依赖后进行动态调用
/**
* 参数为对象实体
*/
public static void pojoCxfClient(){
// 创建动态客户端
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
//此处创建成功客户端会在控制台打印创建的动态对象,如:com.***.test
Client client = dcf.createClient(testU