Forum Discussion

jayrdi's avatar
jayrdi
Occasional Contributor
12 years ago

Selecting multiple fields for Property Transfer

I am trying to automate data retrieval from a website (Web of Science) using their Web Service. I have access to their API and am using the SoapUI software to send SOAP requests to their server and pulling data from the SOAP responses into an Excel spreadsheet. I can't attach screenshots as it comes up with an error message of 'invalid file' so I'll just try to explain it as best I can.

The first SOAP response provides a list of UID fields that are each enclosed in a <REC> tag. I am trying to transfer these UID values to another SOAP request that will extract certain data from each.

It only seems to pass one (the first in this case) UID through for a 'Data Retrieval' SOAP Request. I need it to select all the UID fields from within the <records> tag to pass into another SOAP request using Property Transfer.

I have tried to set up the XPath settings in Property Transfer for Source to select all the UIDs (the 'Data Retrieval' SOAP Request will accept a list of UIDs within its <uid> tags). Using the Wizard in the Property Transfer window I can select the first UID field which provides the following XPath for the Source Property:

//ns2:searchResponse[1]/return[1]/records[1]/ns1:records[1]/ns1:REC[1]/ns1:UID[1]


the next one is

//ns2:searchResponse[1]/return[1]/records[1]/ns1:records[1]/ns1:REC[2]/ns1:UID[1]


then

//ns2:searchResponse[1]/return[1]/records[1]/ns1:records[1]/ns1:REC[3]/ns1:UID[1]​


and so on. Is there a way to type this XPath to select all the UID fields which exist in the tags REC[1-100]? I have tried simply
//ns2:UID
but that still only selects the first one!

I have also tried exporting the data to Excel using a DataSink but still have the same problem that it only exports the first UID field.

Any help with this would be greatly appreciated as I've hit a wall now!

Thanks a lot,

John

1 Reply

  • Hello,

    Instead of using property transfer, try using property expansion and see if its easier for you. All you have to do is right click on the piece of the request where you want to insert the data from the previous response, click on get data and select the Step>data that you want to insert. Please check http://www.soapui.org/Working-with-soap ... sting.html for more information. Hope this helps.

    Regards,
    Temil