Validating XML output with map

pchudjhp

New Member
I have a general problem solving problem. I'm trying to validate a SOAP request using Groovy through SOAP UI. I am receiving a number of attributes for a given item and need to validate each attribute in that item with corresponding column in a DB (i.e. if attribute size has value 4, i need to confirm the DB value under column 'size' has value 4).However, some attributes in the xml appear twice. When this happens, that means that the corresponding DB query has a multi-row reponse. At first I tried to create a map of the attributes to their values, but because there are multiple occurences of the same key, this became difficult. I'm not sure what the best datatype is, but i'd like to have something like the following:\[code\][attribute1 : ["red"], attribute2: ["purple","green"] ...] \[/code\]And be able to say something like, if attribute2 has more than one value assigned to it, loop through the multi-row DB reponse and look for that column's value and compare.Thanks, hope this is clear
 
Back
Top