CXF生成客户端代码
下载CXF
http://cxf.apache.org/download.html
下载最新版本:apache-cxf-3.3.2.zip
解压到本地,配置环境变量
配置path
生成客户端代码
D:\tmp\cc>wsdl2java http://localhost:8080/cxf02/ws/HelloService?wsdl
生成文件
客户端调用生成的代码
package com.sky.cxf01.client;
import com.sky.cxf01.service.HelloService;
import com.sky.cxf01.service.impl.HelloServiceImplService;
public class Client {
public static void main(String[] args) {
HelloService service = new HelloServiceImplService().getHelloServiceImplPort();
String sayHello = service.sayHello("明明");
System.err.println(sayHello);
// 输出结果: Hello, 明明
}
}