
import com.gyf.weather.WeatherInterface;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import java.util.List;
public class Main {
public static void main(String[] args) {
System.out.println("Hello World!");
//使用CXF方式调用
//1.创建式bean
JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
//2.设置接口
factoryBean.setServiceClass(WeatherInterface.class);
//3.设置的地址
factoryBean.setAddress("http://127.0.0.1:12345/weather?wsdl");
//4.创建服务
WeatherInterface ws = factoryBean.create(WeatherInterface.class);
List<String > cities = ws.getCityNameByProvince("广西");
System.out.println(ws.queryWeather("广州"));
System.out.println(cities);
}
}