Forum Discussion

bc1234's avatar
bc1234
New Contributor
13 years ago

how to SOAP respose based on criterion then send to next

Hi,
I have the following response from one of SOAP Request:

<Resposne>

<Planname>test1<Planname>
<Price> 20<Price>
<Country>VT<Country>

<Planname>test1<Planname>
<Price> 23<Price>
<Country>US<Country>

<Planname>test1<Planname>
<Price> 200<Price>
<Country>IR<Country>

<Planname>test1<Planname>
<Price> 200<Price>
<Country>BR<Country>

<Planname>test2<Planname>
<Price> 2<Price>
<Country>US<Country>

<Planname>test2<Planname>
<Price> 2<Price>
<Country>BR<Country>
<Resposne>

I need to scan SOAP resposne where <Price> 200<Price> and then send corresponding Country name to next teststep of country field.

If there is two conury having <Price> 200<Price> then any one is fine.

Please note that Response is not always Ordered and sometimes it could be happed that there is no <Price> 200<Price> and in that case we need to send NULL/BLANK to next teststep of country field.

I know this could be acived by Groovy script but not sure how?

1 Reply

  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    Yes, groovy script is a good approach to solve your problems. that means just need to find the designated field and fetch the value and then transfer it to next step. as for response that sometimes there is no <price> node, I think this is simple for scripts to determine. so if you provide detailed information regarding your expected results, maybe I can give out the solution of your questions.


    thanks,
    Aaron