cxf调用webservice总结
public class UserWebserviceProxy { ? private JaxWsProxyFactoryBean factoryBean; public JaxWsProxyFactoryBean proxyFactoryBean(String url) throws Exception { factoryBean = new JaxWsProxyFactoryBean(); factoryBean.getInInterceptors().add(new LoggingInInterceptor()); factoryBean.getOutInterceptors().add(new LoggingOutInterceptor()); factoryBean.setAddress(url); return factoryBean; } // 用户登陆 public IUserInfoResponse userInfoLogin(String arg0,String arg1,String arg2,String arg3) throws Exception { factoryBean.setServiceClass(IClientUserService.class); IClientUserService approvalService = (IClientUserService) factoryBean .create(); return approvalService.userInfoLogin(arg0,arg1,arg2,arg3); } 在Action类进行调用: // 远程调用 String root = (String) PropertiesUtil.getValByKey("webservice_url",CommonConstants.CONFIG_FILE_PATH); UserWebserviceProxy websrviceProxy = new UserWebserviceProxy(); websrviceProxy.proxyFactoryBean(root); user.setPlatformId(CommonConstants.WISDOM_PLATFORM); String ip = InetAddress.getLocalHost().getHostAddress(); userInfoResponse = websrviceProxy.userInfoLogin(user.getUserName(),user.getPassword(),ip,user.getPlatformId()); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |