2017-07-24 66 views
0

我無法訪問屬性部分中提到的資源屬性test1WSO2 API管理器 - 無法訪問資源屬性

我試圖通過使用表達式來訪問它。 get-property('test1')。我期待在控制檯的這個結果爲test1-value。但是顯示爲nullenter image description here

更新

我曾嘗試以下選項,但沒有什麼工作這個test1屬性。

<property expression="get-property('registry', 'gov:/data/xml/[email protected]')" name="test_property2"/> 
<property expression="get-property('registry', 'gov:/_system/governance/apimgt/customsequences/in/[email protected]')" name="test_property4"/> 
<property expression="get-property('gov:/_system/governance/apimgt/customsequences/in/[email protected]')" name="test_property6"/> 
+0

請嘗試https://stackoverflow.com/questions/11210545/loading-a-registry-entry-into-a-wso2-property-mediator – Pubci

回答

0

要獲得test1值,使用下列財產。

<property expression="get-property('registry', 'gov:/apimgt/customsequences/in/[email protected]')" name="test_property5"/> 

從上面的例子中,資源的位置顯示爲/_system/governance/apimgt/customsequences/in/Seq1.xml。因此,爲了使其路徑,我們將使用子路徑,並從一開始就離開/_system/governance。路徑將是gov:/apimgt/customsequences/in/Seq1.xml。現在訪問test1屬性,只需將@test1附加到路徑。