您的位置:首页 > 编程语言 > Java开发

Java 调用CXF webService 接口

2015-10-26 17:37 453 查看
import org.apache.cxf.interceptor.LoggingInInterceptor;import org.apache.cxf.interceptor.LoggingOutInterceptor;import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;/*** @Description: TODO(用一句话描述该文件做什么)* @author Alpha* @date 2015年10月26日 下午3:46:22* @version V1.0*/public class Test {public static void main(String[] args) {JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();factory.getInInterceptors().add(new LoggingInInterceptor());factory.getOutInterceptors().add(new LoggingOutInterceptor());String address = "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl";factory.setAddress(address);factory.setServiceClass(WeatherWebServiceSoap.class);WeatherWebServiceSoap  client = (WeatherWebServiceSoap) factory.create();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Java 调用CXF webServic