添加SOAP securityHeader | WS:出站网关

时间:2015-09-03 23:50:12

标签: soap spring-integration ws-security

目前我有一个调用出站SOAP服务的wsgateway。现在,提供程序希望将安全标头添加到传出的SOAP消息中。

我需要在下面作为SOAP:Header的一部分包含,以便成功获得服务调用。

<wsse:Security soapenv:mustUnderstand="1"
            xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>xxxx</wsse:Username>
                <wsse:Password  Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxx</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>

如何使用Header richher或mapper来解决这个问题。 目前的实施:

<int:chain input-channel="doOutBoundCallNow" output-channel="printChannel">
            <ws:outbound-gateway uri="http://localhost:8082/mockBinding"></ws:outbound-gateway>



</int:chain>

1 个答案:

答案 0 :(得分:0)

您是否看过Spring WS documentation

您应为Wss4jSecurityInterceptor配置WSHandlerConstants.USERNAME_TOKEN,并将此interceptor添加到<int-ws:outbound-gateway>