Forum Discussion

jkrier's avatar
Regular Contributor
7 years ago

DataSource-XML not returning data

I have an XML response that loos like this



I want to iterate over this response with a DataSource/DataSourceLoop

So I configured DataSource-XML step as


Property = 'documentName'

Source Step = XML

Source Property = Response

Row Xpath = //ns1:getDocumentNamesResponse[1]/ns1:documentName[1]

Column Xpaths = documentName/text()


But this returns nothing


I also tried


Changing the Column Xpath to just "ns1:documentName[1]" and now it returns the first documentName but nothing else. I tried changing it to ns1:documentName[] and ns1:documentName but then nothing is returned.


Row Xpath = //ns1:getDocumentNamesResponse[1]/ns1:documentName

Column Xpath = ns1:documentName

this returned 100 empty rows (100 is the total count, I manually shortened the xml to make it easier to read on here)


Row Xpath = //ns1:getDocumentNamesResponse[1]

Column Xpath = ns1:documentName

This returned just the first documentName element


If anyone can offer any advice i'd appreciate it.

  • Well I managed to get it to work with that note.


    Row XPATH should be (including whatever namespaces you have, so ns1?)





    Column XPATH:



    Can you try that?

    (Edit for missing / on row xpath)


  • jkrier's avatar
    7 years ago

    You really got my hopes up.


    Made the Row Xpath

    declare namespace ns1='mynamespace';



    Column XPath



    But I get 0 results


    So then I tried

    declare namespace ns1='mynamespace';



    So the difference is the slashes, "//" versus "/" and guess what? IT WORKS!!!!!!




    I really can't thank you enough for all the time you spent helping me. This will greatly enhance my tests and something I've been wanting to do for a long time but it just never worked for me so I would work around it.

31 Replies

    • sanj's avatar
      Super Contributor

      What are you trying to do?

      this sounds like something that can be easily resolved with groovy scripting instead of datasource

      • jkrier's avatar
        Regular Contributor

        I am trying to use built in functionality with SoapUI Pro. Yes, I know I could do this with some scripting but I have paid for a pro license so I expect that these features should work.


        I am trying to use an XML response as my DataSource to use in conjunction with a DataSource Loop. This is basic functionality with the pro version (I've just never had a need before).


        So yeah, could I fix it with scripting, yes, I could.


        Do I want to do that, no, I do not.