How can we dynamically add a Header to a Rest Web Service Call?

Requirement: I have a process flow that calls a service that I want to publish to Adeptia. This process flow needs to call a REST web service and it includes an Authentication header. Can I add this Authentication header dynamically through a Data Mapping? As each of our clients has a unique Client ID which uses as an Authorization.

Solution: You can handle this scenario in Data Mapping by performing the following mentioned steps:-

  1. For each Client ID/Client, you have different authorization. You can store all these authorization in a value map on the basis of the client or its ID as per your requirement.
  2. Now, use the context variable on the target side (As an Example 'ClientAuthorization') and store the value in this variable dynamically from the value map on the basis of different client/clientID.
  3. Since the variable 'ClientAuthorization' is a context variable so, you can fetch this value in the Authorization Header as $$ClientAuthorization$$ in Rest Ws Consumer activity as shown below.

Authorization.png

By this approach, the Header is set dynamically for a different client.

Have more questions? Submit a request

0 Comments

Article is closed for comments.