Forum Discussion

gniposoave's avatar
gniposoave
Occasional Contributor
5 years ago

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

    • gniposoave's avatar
      gniposoave
      Occasional Contributor

      Hello nmrao and thank for your reply.

      I guess that link doesn't fit well with my needs:

      1. 1. I have not simple values (like cat.ID in the sample project you linked me to, but complex nodes (as you can see from my sample) as I wrote in my original post
      2. 2. I have SOAP request, so it's not easy to carry the code included in the sample project from REST/JSON to SOAP/XML.

      I would expect there is a trick to pass all <travelSolutions> nodes in an easy way, such as (using property transfer, for example)

      //*:searchbase/*:travelSolutions/*

      adding wildchar '*' at the end., or something like this.

      I've seen some samles of Groovy scripts, but none applies  to my scenario

      Thank for helping me.

       

       

       

      • nmrao's avatar
        nmrao
        Champion Level 3
        Thought you are looking for data driven approach.

        Otherwise can you specify the desired output with sample data?