Search code examples
wso2wso2-data-services-serverwso2-esb

How to Access the Client Header Request


i am getting the data from mobile client they are sending data in JSON as well as sending some values as HEADER to WSO2ESB i am getting normal values using this property

<property name="asset" expression="//asset/text()" scope="default"/>

but how can i get HEADER in my ESB i am using this property its not not working

<property name="username" expression="get-property('transport', 'Accept')"/>

how it will work will you revert me as soon as Thanks in advance


Solution

  • <property name="username" expression="get-property('transport', 'Accept')"/>
    

    In this configuration you are trying to assign an http header named 'Accept' to a property named 'username'.

    If 'username' is what you want to access from the http headers, it should look like:

    <property name="some_name_here" expression="get-property('transport', 'username')"/>