Lakshmikanth
Lakshmikanth

Reputation: 31

fetch access_token from the response and passing in Request Header of Rest Service

I have started using Soapui recently and i need an help.

I am able to fetch access_token from the response using Transfer Property. Transfer Property

Now I need to use ‘access_token’ in the next request header as in the screenshot and how can I achieve this. (Need to automate passing access_token to the request header)

Request Header

I have done some research but i dint find anything on this part. Appreciate your response i am using SoapUI 5.3.0

Upvotes: 1

Views: 108

Answers (1)

SiKing
SiKing

Reputation: 10329

You can use Property Expansion.

Set the value of the header to ${Token#Response#$.token_type} ${Token#Response#$.access_token}. This expands to the response of your "Token" step, and uses JSONPath to select the value of token_type (which is probably "bearer") and access_token.

Note that the Transfer Property step is not necessary, in this case.

Upvotes: 2

Related Questions