簡體   English   中英

如何使用Spring Integration調用安全的SOAP服務

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM