CXF 动态客户端调用

CXF直接调用接口进行访问的例子,简要记录,客户端调用的时候WEBSERVICE类和实例类都要打成JAR包供客户端调用。



//创建WebService客户端代理工厂
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
//注册WebService接口
factory.setServiceClass(ZXSjywWebService.class);
//设置WebService地址
factory.setAddress("http://149.0.13.157:8088/zxgl/cxf/zxsjywWebService");
ZXSjywWebService userServices = (ZXSjywWebService)factory.create();
System.out.println("invoke userinfo webservice...");
// 测试返回JavaBean对象的
SjywFfxx ffxx = new SjywFfxx();

ffxx.setCreateDate(new Timestamp(System.currentTimeMillis()));
ffxx.setId("abcd");
ffxx.setCreator("111");
ffxx.setFTitle("TITLE");
ffxx.setFContent("content");
ffxx.setFfId("2222222222");


List list = new ArrayList();
SjywFyFj fj = new SjywFyFj();

fj.setId("aaaa");
fj.setFId("bbbbb");
fj.setFileName("name");
fj.setFydm("M00");
fj.setFymc("高院");
fj.setFileUrl("////");

list.add(fj);

int x = userServices.addFFxx(ffxx, list) ;
System.out.println(x);



详细博文
http://blog.csdn.net/vickychen89/article/details/6606400

你可能感兴趣的:(Webservice,CXF)