Forum Discussion

hepp's avatar
hepp
Occasional Contributor
15 years ago

How to transfer an array to a database.

Good afternoon,
I'm using a web service response which contain some vehicle information and especially a list of equipment which is a repetition of equipment (see below an example). I already set up a datasink in order to store some vehicle information is a MySql database (I use a datasource to have a datadriven test and as well a datasource loop). This allows to loop on the vehicle basic definition.

I would like to know how I could store all equipment items of a given vehicle in a dedicated table? How to configure soapui pro in order to loop on the equipment list od the service response?


 <EquipmentList xsi:type="ns1:ArrayOfEquipment">
<Equipment xsi:type="ns1:OptionType">
<Code>164059</Code>
<NewPrice>0.00</NewPrice>
<MarketCode>0</MarketCode>
<GroupCode>0</GroupCode>
<Valuation xsi:type="ns1:ValuationAmountType">
<TradeAmount>0.00</TradeAmount>
<RetailAmount>0.00</RetailAmount>
<B2Bamount>0.00</B2Bamount>
</Valuation>
</Equipment>
<Equipment xsi:type="ns1:OptionType">
<Code>1688</Code>
<NewPrice>600.00</NewPrice>
<MarketCode>0</MarketCode>
<GroupCode>0</GroupCode>
<Valuation xsi:type="ns1:ValuationAmountType">
<TradeAmount>123.00</TradeAmount>
<RetailAmount>164.00</RetailAmount>
<B2Bamount>164.00</B2Bamount>
</Valuation>
</Equipment>
<Equipment xsi:type="ns1:OptionType">
<Code>164074</Code>
<NewPrice>0.00</NewPrice>
<MarketCode>0</MarketCode>
<GroupCode>0</GroupCode>
<Valuation xsi:type="ns1:ValuationAmountType">
<TradeAmount>0.00</TradeAmount>
<RetailAmount>0.00</RetailAmount>
<B2Bamount>0.00</B2Bamount>
</Valuation>
</Equipment>
</EquipmentList>