Forum Discussion

GeorgeTret's avatar
GeorgeTret
New Contributor
10 years ago

XML DataSource - Extract Data from a SOAP Response

Hey guys, I am a new user to the forums so excuse my lack of experience. I'll try to keep this as brief and informative as I can and hopefully someone can help me out.

I have a test that can be executed to produce a response that contains the xml data I wish to extract. Please see the picture below for the structure of it.



Now what I am interested in is storing this data in a DataSource directly from the test's response. In essence, I want to be able to run the test first (to produce the response) followed by the DataSource (as XML) to store the data from the response that I need.

I want to be able to reiterate through the response and extract "col_1" and "col_3" from the elements iterated ("DATA").

I've tried the following but it hasn't worked:



I've hit a wall, could anyone please help or give me some pointers on where I am going wrong?

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Please confirm if the following understanding is correct?
    1. A request step is run, and received a response which is an xml.
    2. You would like to store the response in a file
    3. And do not understand another point iteate data for certain columns. What are you trying to achieve?

    Is that all?
  • GeorgeTret's avatar
    GeorgeTret
    New Contributor
    nmrao wrote:
    Please confirm if the following understanding is correct?
    1. A request step is run, and received a response which is an xml.
    2. You would like to store the response in a file
    3. And do not understand another point iteate data for certain columns. What are you trying to achieve?

    Is that all?


    Thanks for getting back to me.

    1. Yes, a request is executed and the following XML response is produced.
    2. I would like to store col_1 (VariableName) and col_3 (Value) in a DataSource or as a file, either is fine.
    3. I am trying to iterate through all the "DATA" elements and extract their individual col_1 and col_3 (their variable name and value) and store these for use with a later SOAP request. The screen shot of the XML structure is not perfectly clear but the XML response contains numerous "DATA" elements (all of which have the same columns, just different values) and I'd like to extract the information above from each other. I hope this has cleared it up a little bit.