添加SOAP securityHeader | ws:出站网关

添加SOAP securityHeader | ws:出站网关,soap,spring-integration,ws-security,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">

目前我有一个调用出站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>

xxxx
xxxx
如何使用标头enricher或mapper来解决此问题。 目前的执行情况:

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



</int:chain>

您看过Spring WS了吗


您应该为
WSHandlerConstants.USERNAME\u令牌
配置
Wss4jSecurityInterceptor
,并将此
拦截器添加到
您查看了Spring WS吗


您应该为
WSHandlerConstants.USERNAME\u令牌
配置
Wss4jSecurityInterceptor
,并将此
拦截器添加到

我使用的是spring ws的2.2.2.RELEASE版本。我应该使用哪个版本的wss4j?不确定,但我只会遵循Spring WS依赖关系:在将wss4j升级到1.6.4之后,与设置“UsernameToken”相关的问题action was resolved.org.apache.axiom.soap.SOAPProcessingException:soap信封不能包含soap标头和正文以外的子项此异常现在引发。请共享StackTrace,在您的问题以及Wss4jSecurityInterceptor
的配置中,我使用的是SpringWS的2.2.2.RELEASE版本。我应该使用哪个版本的wss4j?不确定,但我只会遵循Spring WS依赖关系:在将wss4j升级到1.6.4之后,与设置“UsernameToken”相关的问题action was resolved.org.apache.axiom.soap.SOAPProcessingException:soap信封不能有soap标头和正文以外的子项此异常现在引发。请在您的问题中与
Wss4jSecurityInterceptor
的配置一起共享堆栈跟踪。