【问题标题】:How to call a secured SOAP service using Spring Integration如何使用 Spring Integration 调用安全的 SOAP 服务
【发布时间】:2014-12-24 11:50:59
【问题描述】:

我正在使用 Spring Integration 来调用 SOAP 服务。无论如何,我能够通过出站网关调用 SOAP 服务并且我正在接收响应。但现在我需要调用一个安全的 SOAP 服务。如何使用 Spring Integration 调用它。任何人都可以在这个问题上帮助我。提前谢谢你。

【问题讨论】:

  • 您好 user1957631,您所说的“安全”是什么意思?它是使用 HTTPS 保护的,还是需要使用 BASIC 或 DIGEST auth 或类似的方式进行身份验证?您是否尝试过调用安全服务并收到任何错误消息?

标签: java spring web-services soap spring-integration


【解决方案1】:

虽然这是一个相对较旧的线程,但我认为为未来的访问者分享以下详细信息可能会很有用。

要使用 Spring Integration 的 Web 服务出站网关调用安全 Web 服务,您可以将网关 bean 的 interceptor 属性设置为指向您必须指定的拦截器 bean。下面是一个使用纯文本密码的例子:

<bean id="wsSecurityInterceptor"
    class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    <property name="securementActions" value="UsernameToken" />
    <property name="securementUsername" value="${ws-user}" />
    <property name="securementPassword" value="${ws-password}" />
    <property name="securementPasswordType" value="PasswordText" />

<int-ws:outbound-gateway id="yourWebServiceGateway"
        uri="${ws-uri}"
        interceptor="wsSecurityInterceptor" />

请注意,此功能需要 spring-ws-security 和 Apache 的 wss4j 库。

【讨论】:

    【解决方案2】:

    Spring Integration 使用Spring Web Services 进行Web 服务支持;高级配置请参考its documentation

    【讨论】:

      猜你喜欢
      • 2019-01-02
      • 1970-01-01
      • 2017-08-17
      • 2020-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-04
      • 1970-01-01
      相关资源
      最近更新 更多