Forum Discussion

MauraR's avatar
MauraR
Occasional Contributor
15 years ago

parse soap response and pass values to next request

Hi everyone,
I am pretty new to soapui and groovy.
I have a soap response with array of returns having child nodes -- number of returns is unlimited and could go as many as thousands.
Each return may or may not have the same number of child nodes.
Please see below.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:getTIDResponse xmlns:ns2="http://soap.service.thed.com/">
<return>
<tid>161286</tid>
<adate>2011-03-31T00:00:00-04:00</adate>
<etime>0</etime>
<id>10</id>
<rid>609232</rid>
<cid>388</cid>
<aid>0</aid>
</return>
<return>
<tid>161287</tid>
<adate>2011-03-31T00:00:00-04:00</adate>
<etime>0</etime>
<id>1</id>
<rid>609233</rid>
<cid>388</cid>
<aid>0</aid>
</return>
<return>
<tid>0</tid>
<rid>609234</rid>
<cid>388</cid>
</return>
<return>
<tid>0</tid>
<rid>609235</rid>
<cid>388</cid>
</return>

I need to get each tid, rid, and cid for each return and pass it to the next request.
There will be 1 request per return.

The request will look like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.service.thed.com/">
<soapenv:Header/>
<soapenv:Body>
<soap:xxxxx>
<rts>
<tid>?</tid/>
<rid>?</rid>
<cid>?</cid>
</rts>

tid in response will be passed to tid in request, rid->rid, cid->cid.

I would appreciate any help/suggestion on how I could get this to work.
I am using the open source version.

Thanks,
bluemerle
No RepliesBe the first to reply