WSClient客户端调用---apache.cxf

来源:互联网 发布:最小公倍数 c语言 编辑:程序博客网 时间:2024/06/16 17:39
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);    }}

0 0
原创粉丝点击