Sheikh Abdul Wahid
Sheikh Abdul Wahid

Reputation: 2773

WSO2 API Manager - unable to access resource properties

I am not able to access resource property test1, mentioned in property section in the screenshot.

I am trying to access it by using the expression. get-property('test1'). I am expecting this result in console as test1-value. But the is showing as null.enter image description here

Updated

I have tried following options but nothing is working for this test1 property.

<property expression="get-property('registry', 'gov:/data/xml/collectionx@test1')" name="test_property2"/>
<property expression="get-property('registry', 'gov:/_system/governance/apimgt/customsequences/in/Seq1.xml@test1')" name="test_property4"/>
<property expression="get-property('gov:/_system/governance/apimgt/customsequences/in/Seq1.xml@test1')" name="test_property6"/>

Upvotes: 0

Views: 523

Answers (2)

Sheikh Abdul Wahid
Sheikh Abdul Wahid

Reputation: 2773

To get the value of test1, use following property.

<property expression="get-property('registry', 'gov:/apimgt/customsequences/in/Seq1.xml@test1')" name="test_property5"/>

From above example the location of resource is showing /_system/governance/apimgt/customsequences/in/Seq1.xml. So to make its path, we will use subpath and leave /_system/governance from the beginning. The path will be gov:/apimgt/customsequences/in/Seq1.xml. Now to access test1 property, simply append @test1 to the path.

Upvotes: 0

Bee
Bee

Reputation: 12513

Try this.

<property name="regProperty" expression="get-property('registry', 'gov:/data/xml/collectionx@abc')"/>

Ref: http://movingaheadblog.blogspot.com/2015/09/wso2-esb-how-to-read-registry-property.html

Upvotes: 1

Related Questions