spring cxf 配置
发表于:2024-11-22 作者:热门IT资讯网编辑
编辑最后更新 2024年11月22日,版本 -- cxf-2.5.2
id="userDetailsService" implementor="#userDetailsServiceImpl" implementorClass="com.webservice.impl.UserDetailsServiceImpl" address="/userDetailsService" >
地址拦截 白名单
public class AddressInInterceptor extends AbstractPhaseInterceptor
@Resource
com.hotent.platform.service.system.SysAcceptIpService sysAcceptIpService;
public AddressInInterceptor() {
super(Phase.RECEIVE);
}
/**
*拦截器过滤方法。
*/
public void handleMessage(Message message) throws Fault {
HttpServletRequest request = (HttpServletRequest) message.get(AbstractHTTPDestination.HTTP_REQUEST);
String ipAddr=request.getRemoteAddr();
if(!accept(ipAddr))
throw new Fault(new IllegalAccessException("ip地址" + ipAddr + " 拒绝访问"));
}
}
访问地址: http://ip:port/project/service/SystemResourcesService?wsdl