How do I set a property to the value of an incoming http request header? I tried a few things (see following), but my log values are all null, so I'm clearly not reading the header values correctly. The header value I really care about is X-EMPID. Using wso2esb 4.8.1.
Here are a couple of posts that led me to believe this would work, but I'm not having any luck yet.
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="getaccount2"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="empid"
expression="get-property('transport', 'X-EMPID')"
scope="default"
type="STRING"/>
<log level="custom">
<property name="emp_id" expression="get-property('empid')"/>
</log>
<log level="custom">
<property name="content_length"
expression="get-property('transport', 'Content-Length')"/>
</log>
<log level="custom">
<property name="TRANSPORT_HEADERS" expression="get-property('TRANSPORT_HEADERS')"/>
</log>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…