toniboi
13 years agoOccasional Contributor
How to retrieving a specific node from a soap response?
Hello all, this is my first post here and I am new to SoapUI and SoapUI Pro. I came across a property transfer problem recently, and I tried with no luck in googling it for the solution.
So I was practising with a web service from webservicex.net call "country codes", and when I run the ""GetCountry" test request I will get a list of countries as the response.
That is all good until the point that I want to retrieve only one of the countries from the data set, Algeria for instance. It's because I want to transfer the country name to the next test step which is a service taking a country name as a request. I tried to select the node from the response, however I noticed that the XPath I got was pointing to whole response instead of one of those nodes
I guess it is probably very simple question to some of you here, but my XPath skills kind of limit my ability to solve it myself.
Much appreciated if anyone could help.
Tony
So I was practising with a web service from webservicex.net call "country codes", and when I run the ""GetCountry" test request I will get a list of countries as the response.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetCountriesResponse xmlns="http://www.webserviceX.NET">
<GetCountriesResult><![CDATA[<NewDataSet>
<Table>
<Name>Afghanistan, Islamic State of</Name>
</Table>
<Table>
<Name>Albania</Name>
</Table>
<Table>
<Name>Algeria</Name>
</Table>
<Table>
<Name>American Samoa</Name>
</Table>
...
</NewDataSet>]]></GetCountriesResult>
</GetCountriesResponse>
</soap:Body>
</soap:Envelope>
That is all good until the point that I want to retrieve only one of the countries from the data set, Algeria for instance. It's because I want to transfer the country name to the next test step which is a service taking a country name as a request. I tried to select the node from the response, however I noticed that the XPath I got was pointing to whole response instead of one of those nodes
declare namespace ns1='http://www.webserviceX.NET';
//ns1:GetCountriesResponse[1]/ns1:GetCountriesResult[1]
I guess it is probably very simple question to some of you here, but my XPath skills kind of limit my ability to solve it myself.

Tony