SAAJInInterceptor和WSS4JInInterceptor bean的Java配置

时间:2016-12-01 09:55:25

标签: spring-boot cxf ws-security

我有一个Web应用程序,它使用apache cxf和spring boot提供soap web服务。所以我的classpath中没有xml文件来配置我的bean,它们都是在java配置中配置的。我想用cxf中的ws-security设置身份验证。 所以我想知道是否有SAAJInInterceptor和WSS4JInInterceptor bean的java配置,例如:

<aside>

    <ul>
        <li><a href="#one">One</a></li>
        <li><a href="#two">Two</a></li>
        <li><a href="#three">Three</a></li>
        <li><a href="#four">Four</a></li>
        <li><a href="#five">Five</a></li>
        <li><a href="#six">Six</a></li>
    </ul>
</aside>

$(document).ready(function(){
// = Вешаем событие прокрутки к нужному месту
    //   на все ссылки якорь которых начинается на #
    $('a[href^="#"]').bind('click.smoothscroll',function (e) {
        e.preventDefault();

        var target = this.hash,
        $target = $(target);

        $('html, body').stop().animate({
            'scrollTop': $target.offset().top-($('ul').height()+ 100)  
        }, 900, 'swing', function () {
            window.location.hash = target;
        });
    });

});

#main h2 {
    margin-top:400px;
}
ul{
    position:fixed;
    top: 0px;
}
ul li{
    display:inline-block;
}

1 个答案:

答案 0 :(得分:0)

您只需在创建端点时添加拦截器:

Map<String,Object> interceptorConfig = new HashMap<String,Object>();
// set the properties of you WSS4J config
// ...
WSS4JInInterceptor myInterceptor = new WSS4JInInterceptor(interceptorConfig);
myEndpoint.getInInterceptors().add(myInterceptor);

另一种解决方案是使用@InInterceptors

的注释
相关问题