如何使用Spring Integration调用安全的SOAP服务

时间:2014-12-24 11:51:00

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

我正在使用Spring Integration来调用SOAP服务。无论如何,我能够通过出站网关调用SOAP服务,我收到了响应。但现在我需要调用一个受保护的SOAP服务。如何使用Spring Integration调用它。任何人都可以帮我解决这个问题。提前谢谢。

2 个答案:

答案 0 :(得分: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库才能实现此目的。

答案 1 :(得分:0)

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

相关问题