Pramod
Pramod

Reputation: 731

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.

Upvotes: 0

Views: 577

Answers (2)

Taoufik Mohdit
Taoufik Mohdit

Reputation: 1951

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.

Upvotes: 1

Gary Russell
Gary Russell

Reputation: 174819

Spring Integration uses Spring Web Services for the web service support; refer to its documentation for advanced configuration.

Upvotes: 0

Related Questions