Forum Discussion
- JHuntCommunity Hero
Are you referring to a SoapUI Pro DataSource? If you are, please move your post to the SoapUI Pro forum.
Otherwise, please be specific:
What is the XML you want to update? (Post the real thing or a modified example that we can work with).
When should it be updated?
What should the result look like, based on the starting XML?
- MRAONew Contributor
HI xml we need to manipulate. it is in soap ui free version only we need to increase the Participantcount tag dynamically using groovy when we give count as per from csv/excel file
- JHuntCommunity Hero
You can turn a request like this:
<request> <a>${a}</a> <b>${b}</a> <ParticipantCount>${age1}</ParticipantCount>
<ParticipantCount>${age2}</ParticipantCount>
<ParticipantCount>${age3}</ParticipantCount>
</request>Into one like this:
<request> <a>${a}</a> <b>${b}</a> ${participants}
</request>Then you just need to build 'participants' with some sort of a loop across all the data.
String s = "" for (Participant p : getParticipants()) { s += "<ParticipantCount>${p.age}</ParticipantCount>\n" } context['participantsAsXml'] = s
Is that what you meant?
- MRAONew Contributor
Hi wasnt able to understand it properly can u please give a detail on it please find updated Request XML
<InterfaceRQ xmlns="*****">
<RequestHeader>
<UserID>${#TestSuite#UserID}</UserID>
<SessionID>${#TestSuite#SessionID}</SessionID>
<TransactionID>${#TestSuite#TransactionID}</TransactionID>
<SupplierCredentialsList>
<SupplierCredentials>
<SupplierID>${#TestSuite#SupplierID}</SupplierID>
<Sequence>1</Sequence>
<Credentials>
<Credential name="${#TestSuite#CredOne}" isEncrypted="${#TestSuite#Encyp}">${#TestSuite#USERNAME}</Credential>
<OperationURLs>
<OperationURL operation="all">${#TestSuite#OperationURL}</OperationURL>
</OperationURLs>
</Credentials>
</SupplierCredentials>
</SupplierCredentialsList>
</RequestHeader>
<RequestBody>
<OTA_TourAvailRQ>
<ProcessingInformation PricingCurrency="${#TestSuite#PricingCurrency}"/>
<Tour>
<Location>
<Address>
<CountryName Code="${#TestSuite#CountryName}"/>
</Address>
<Region RegionCode="${#TestSuite#RegionCode}" />
</Location>
<Schedule StartPeriod="${#TestSuite#StartPeriod}" EndPeriod="${#TestSuite#EndPeriod}"/>
<Participant Quantity="${#TestSuite#Quantity}" Age="${#TestSuite#Age}">
<QualifierInfo Extension="">${#TestSuite#Extension}</QualifierInfo>
<!-- Value Can be Adult,Child,Infant -->
</Participant>
</Tour>
</OTA_TourAvailRQ>
</RequestBody>
</SightSeeingInterfaceRQ>- nmraoChampion Level 3In the above xml, there is no "ParticipantCount". Is it missing?
Related Content
- 11 years ago
- 2 years ago
- 12 years ago
- 10 years ago
Recent Discussions
- 15 years ago