cracknut
cracknut

Reputation: 307

WSO2 EI/ESB : How to use/manage Incoming Header Parameters to use them in second back-end call?

In my case, while calling the process API from Postman, I'm passing the required headers from Postman itself. Now, the API has two sequential back-end calls, both require same headers. The headers are working fine for the first back-end call. For the second back-end call, I'm getting "Authorization error : Missing Credentials".

I want to use same headers for both back-end calls.

How do I save the incoming headers and pass them to the second back-end call?

Upvotes: 1

Views: 902

Answers (1)

Arunan
Arunan

Reputation: 3441

Save the transport headers before the first call into a property like below. This would save the property in the message context. $trp indicates that we are reading the incoming transport headers.

<property expression="$trp:Authorization" name="AuthorizationCode" scope="default"/>

After the first call is made, put back the transport header. $ctx means that we are reading from the message Context. We are saving it with the scope transport because we want it to be sent as a Transport Header.

<property expression="$ctx:AuthorizationCode" name="Authorization" scope="transport"/>

Upvotes: 2

Related Questions