简体   繁体   English

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

[英]How to call a secured SOAP service using Spring Integration

I am working on Spring Integration for calling a SOAP services. 我正在使用Spring Integration来调用SOAP服务。 Anyhow I am able to call a SOAP service through outbound gateways and I am receiving the response. 无论如何,我能够通过出站网关调用SOAP服务,并且收到响应。 But now I need to call a SOAP service which is secured. 但是现在我需要调用一个安全的SOAP服务。 How to call this using Spring Integration. 如何使用Spring Integration调用它。 Can anyone help me out in this issue. 谁能帮我解决这个问题。 Thank you in advance. 先感谢您。

Although this is a relatively old thread, I thought it might be useful to share the following details for future visitors. 尽管这是一个相对较旧的主题,但我认为与以后的访问者分享以下详细信息可能会很有用。

To invoke a secured web service using Spring Integration's web service outbound gateway, you can set the interceptor attribute of the gateway bean to point to an interceptor bean which you will have to specify. 要使用Spring Integration的Web服务出站网关调用安全的Web服务,可以将网关bean的interceptor属性设置为指向您必须指定的拦截器bean。 An example below using plain text password: 下面是使用纯文本密码的示例:

<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" />

Note that spring-ws-security and Apache's wss4j libraries will be required for this to work. 请注意,将需要spring-ws-security和Apache的wss4j库才能起作用。

Spring Integration uses Spring Web Services for the web service support; Spring Integration使用Spring Web Services获得Web服务支持。 refer to its documentation for advanced configuration. 有关高级配置,请参阅其文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM