Forum Discussion

Emil91's avatar
Emil91
Contributor
8 years ago

help! I need to transfer message ID from RAW response in soapUI NG pro in (Rest project)

Is there any chance to transfer such id from RAW response?

All i need  is something which is unique every time and in this case I found that RAW response of my request is generating message ID and every time  i send new request the message ID is different, now I need to transfer such ID to the GET method endpoint which is responsible for getting the result of consumed request. That is first idea

 

I can also mention that Json request which I'm sending contains "uuid": "770" <-- The number is randomized every new request, I can see this in RAW request, I wonder if it's possible to transfer "uuid" content from RAW request and move it to GET endpoint URL, if that is possible it would safe my arseholl as well, Thanks "from the mountain" ;D That is second idea

 

I'm stuck at this moment, I've done research on google and wasted lot of time, I need to figure this out and need help because When I send several requests I'm able to GET all of them.. and that's not the point.

I want to be able to only GET requests with unique ID, I hope I'm clear enough, I've attached a screenshot which shows the RAW response of my request, Thanks in advance for help this is very important for me, cheers.

 

Best Regards

 

Emil

  • nmrao's avatar
    nmrao
    Champion Level 3

    Emil91,

     

    In your case, messageID is response header.

     

    You can use below Script Assertion to retrieve the same:

     

     

    def msgId = messageExchange.responseHeaders['messageID'][0]
    log.info msgId
    assert msgId, 'messageID is empty or null'
    context.testCase.setPropertyValue('MSG_ID', msgId)

     

     

     

    In later steps (of the same test case), wherever messageID is needed, use ${#TestCase#MSG_ID}

  • sanj's avatar
    sanj
    Super Contributor

    go onto outline view for the request

    Click on Transfer from and select the test steps response that you want to transfer the data from

    I have attached screenshot for illustration