How to pass a list of nodes from a response to a new request
Hi to all. I'm new in this community and I have a proiblem that is going me mad
I searched in the community, but didn' t find what I am looking for.
I have a SOAP response, composed by multiple complex nodes. For example
<travelSolution>
<field1>something</field1>
<field2>
<id>12345</id>
</field2>
<context>
<searchCriteria>
<departureTimesStart>2020-04-24T10:47:02.635</departureTimesStart>
</searchCriteria>
</context>
</travelSolution>
<travelSolution>
<field1>something else</field1>
<field2>
<id>678</id>
</field2>
<context>
<searchCriteria>
<departureTimesStart>2020-04-24T10:54:02.635</departureTimesStart>
</searchCriteria>
</context>
</travelSolution>
<travelSolution>
.......
.......
</travelSolution>
What i want to do is to pass the list of travelSolution objects to the next request.
I've tried with "property transfer" but it passes only the numer of objects already defined in the request.
For example if in the response there is a list with five <travelSolutions> objects, but in the receiving request there are only three objects present, only the first three objects will populate the request.
The number of <travelSolutions> objects is unpredictable. I want to transfer them all, to the new request for subsequent processing.
I've tried with a groovy script but I'm facing problems because DOM3 level is not supported
I'm using soapUI free edition 5.5
May someone please help me?
Thanks in advance
Thanks for adding files.
Add a groovy script test step between both the test steps. (where you get the response and request)
There should not be any other step between the two other than this groovy script.
And add script from
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/xml/UpdateNextXmlRequest.groovy
Here is sample one which you can quickly test online
- Can you please try changing
From
responseContentAsString
To:
responseContent
Also updated the script in the git.