配置兼容Spring-WS和CXF的通用Web服务拦截器和usernameTokenValidator

发布于 2024-12-19 12:31:06 字数 1361 浏览 5 评论 0原文

现在,我的 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 (比如 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.

谢谢!

Right now I have below configuration for one of my WS endpoints.

<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>

Now I want to move this bean="myServiceInterceptor" and custom userNameToken Validator config (jaxws:properties) to a separate jar (say A). So that any spring WS using that jar A , can leverage same interceptor and customUseranameToken functionality.

My questions:

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.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泛泛之交 2024-12-26 12:31:06

大多数内容可以在总线级别进行配置,因此可以由使用该总线的任何内容继承:

<cxf:bus>
   <cxf:inInterceptors>....
   <cxf:properties>....
</cxf:bus>

MOST of the stuff could be configured at the Bus level and thus inherited by anything that uses that bus:

<cxf:bus>
   <cxf:inInterceptors>....
   <cxf:properties>....
</cxf:bus>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文