Search code examples
wso2wso2-micro-integrator

is there any way to fill transport header from file.properties?


in one of my questions , i got solution for my header issue , it turned out that i need to get header value from file.properties

i tried following code but value is showing to be null

<property name="API_KEY" expression="get-property('conf:/config.properties', 'API_KEY')" scope="default" type="STRING" />

<header name="Authorization" value="Bearer $ctx:API_KEY" />

i also tried $FILE:API_KEY but it didnt work too


Solution

  • Assuming you have configured file.properties file. You can do something like below to set a transport header.

    <property name="MyHeader" expression="get-property('file','YOUR_KEY_NAME')" scope="transport" />