[英]How to call a secured SOAP service using Spring Integration
我正在使用Spring Integration来调用SOAP服务。 无论如何,我能够通过出站网关调用SOAP服务,并且收到响应。 但是现在我需要调用一个安全的SOAP服务。 如何使用Spring Integration调用它。 谁能帮我解决这个问题。 先感谢您。
尽管这是一个相对较旧的主题,但我认为与以后的访问者分享以下详细信息可能会很有用。
要使用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
库才能起作用。
Spring Integration使用Spring Web Services获得Web服务支持。 有关高级配置,请参阅其文档 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.