OSB Message-Level Custom Security

本文描述OSB Message-Level Custom Security的實現過程(demo)

1、創建test.wsdl文件,其中包括傳遞進來用於驗證身份的用戶名和密碼:user,pwd. 如下圖所示:這裏寫圖片描述
這裏寫圖片描述

這裏寫圖片描述
這裏寫圖片描述

這裏寫圖片描述

2、創建兩個proxyservices:psSyncData.proxy和psStar.proxy

其中psSyncData.proxy主要用於處理業務邏輯和驗證身份,psStar.proxy則是爲psSyncData.proxy提供驗證信息的信息提供者

對於psStar.proxy的設置如下:

1)在Message Flow中設置Routing,Routing的service指向psSyncData.proxy;

2)在Request Action中設置兩個insert,向header變量中插入兩個參數user和pwd,這倆參數會在psSyncData.proxy的security中被引用;
這裏寫圖片描述

psSyncData.proxy需要做設置如下:

1)Service Type選擇:Any Type SOAP Service

2)在security tab中,選擇Custom User Name and Password並定義User Name/Password XPath,如下圖:

這裏寫圖片描述

3)在Mssage Flow中,調用業務處理所用的businessServices,並將Soap的header替換還原成正確的,否則可能會引起Internal Server Error
這裏寫圖片描述

以上傳入的用戶名和密碼是用weblogic進行驗證的,因此用戶名和密碼需要預先在weblogic的安全域裏設置好。

以上爲Message -Level Custom Security的簡單設置步驟

常見報錯:


soapenv:Server
BEA-386101: Missing authentication token

原因爲:在ProxyServices中設置的user和password與soap header中設置token不一致。

如在soap header中設置如下:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章