微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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());

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐