Forum Discussion

madden1942's avatar
madden1942
Occasional Contributor
10 years ago

Transferring response parameters into the header

Hi,

I am new to SoapUI Pro. My current Project is using a large amount of REST services to talk between the front end and the back end of the website. We have no access to the front end and are only developing the back end.

I have a scenario where a customer logs in which triggers the log in service. The response from this service has 4 Tokens for use in further service headers to identify the customer.

What i am struggling to do is transfer these tokens automatically from the response of the first service into the header of the following services.

Can anyone help?

Thanks
Tim

2 Replies

  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    How is the tokens being transmitted from one to the next?

    If it is a parameter than you just need to get the token from the first step (Several different ways to do this, search for "SoapUI Property Transfer" or check out here.

    If the parameter is a cookie than you need to check "Maintain HTTP Sessions" in your TestCase Options (CTRL+Shift+O on windows)

    If something else, please be more specific.
  • madden1942's avatar
    madden1942
    Occasional Contributor
    Hi PaulM,

    Thanks for the reply!

    To try and be a little clearer these are the steps

    1 - Login service is sent to log the customer in
    2 - successful login returns a response with the following in the JSON;


    "WCToken": "16073%2cJxYrqS1bdrjPgOFaDQCXin4HwFTi85hzeTTuhIMsqjhqofQQfqwvh1UwqbvA2q24QeGsOaOjy2sjnixquLc%2bhi%2bmGQ180Hc8Z%2fD3kLx5kI5x8yxmXCPFUNQ6PTAPL%2bAtyIRJ47hU%2bg6omWaAHxXcnrHKM32J25hoMmpK%2b5sJ5ocwIY49LW70%2bDirB%2bCmtAQIZRCfuHK2n9YiA0FKmP1VDA%3d%3d",
    "WCTrustedToken": "16073%2c5RMrBkCP7FZUOyDkvj0aj8PIQdI%3d",


    3 - All of the following services require the above 2 'attributes' with their values to be sent in the header rather than the body of the message.

    The bit that i am stuggling with is how to set up the subsequent services to use the 2 header values from the initial response.

    Hope that helps!

    Tim