简体   繁体   中英

How to call a secured SOAP service using Spring Integration

I am working on Spring Integration for calling a SOAP services. Anyhow I am able to call a SOAP service through outbound gateways and I am receiving the response. But now I need to call a SOAP service which is secured. How to call this using 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. 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 Integration uses Spring Web Services for the web service support; refer to its documentation for advanced configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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