【问题标题】:Configure a common webservice interceptor and usernameTokenValidator compatible with Spring-WS and CXF配置一个通用的webservice拦截器和usernameTokenValidator兼容Spring-WS和CXF
【发布时间】:2011-12-05 16:15:09
【问题描述】:

现在我的 WS 端点之一具有以下配置。

<jaxws:endpoint id="myService" implementor="#myServiceImpl" address="/myService">
<jaxws:inInterceptors>
  <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
  <ref bean="myServiceInterceptor"/>
</jaxws:inInterceptors>
 <jaxws:properties>
<entry key="ws-security.ut.validator" value-ref="myServiceUsernameTokenValidator"/>
<jaxws:properties>
</jaxws:endpoint>

 <bean id=" myServiceInterceptor " class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
   <constructor-arg>                              
     <map>
        <entry key="action" value="UsernameToken" />
        <entry key="passwordType" value="PasswordText" />
      </map>          
    </constructor-arg>
</ bean>

现在我想将此 bean="myServiceInterceptor" 和自定义 userNameToken Validator 配置 (jaxws:properties) 移动到单独的 jar (say A)。这样任何使用该 jar A 的 spring WS 都可以利用相同的拦截器和 customUseranameToken 功能。

我的问题:

1)  How do I setup/configure a generic webservice security interceptor rather than a cxf specific interceptor.
2)  How can I setup a common <jaxws:properties> that can be used by all the endpoints.

谢谢!

【问题讨论】:

    标签: web-services cxf spring-ws interceptor wss4j


    【解决方案1】:

    大部分东西可以在总线级别进行配置,因此可以被使用该总线的任何东西继承:

    .... .... 总线>

    【讨论】:

    • 根据您上面提到的内容,我相信这仅适用于基于 CXF 的服务。让我这样表达我的目标:我想要一个通用的拦截器,它可以被多个 Web 服务用于 UsernameToken 身份验证(无论是基于 CXF、Spring-WS 还是基于 Axis)。
    猜你喜欢
    • 1970-01-01
    • 2023-03-18
    • 2013-06-03
    • 2012-10-03
    • 1970-01-01
    • 1970-01-01
    • 2014-11-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多