package com.sinoservices.edi.ws;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import com.sinoservices.edi.ws.wsdl.client.HelloWorld;
/**
* 基于CXF的WSClient端调用
* @版权:SINOSERVICES 版权所有 (c) 2013
* @author:Mars
* @version Revision 1.0.0
* @email:Mars.Wei@sinoservices.com
* @see:
* @创建日期:2017年2月23日
* @功能说明:
* @begin
* @修改记录:
* @修改后版本 修改人 修改内容
* @2017年2月23日 Mars 创建
* @end
*/
public class CXFWSClient {
public static void main(String[] args) {
// TODO Auto-generated method stub
clientUtil();
}
public static void clientUtil() {
String wsdlAddress = "http://localhost:8080/jdkwsdemo/HelloWorld";
JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
factoryBean.setServiceClass(HelloWorld.class);
factoryBean.setAddress(wsdlAddress);
HelloWorld hw = (HelloWorld) factoryBean.create();
String doSomething = hw.doSomething();
System.out.println(doSomething);
}
}
WSClient客户端调用---apache.cxf
最新推荐文章于 2024-05-23 09:31:37 发布